@antelopejs/dms-lang 0.9.0 → 0.9.2

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 (55) hide show
  1. package/README.md +2 -2
  2. package/dist/utils/blocks.js +2 -1
  3. package/dist/utils/blocks.js.map +1 -1
  4. package/dist/utils/dialogs.js +2 -1
  5. package/dist/utils/dialogs.js.map +1 -1
  6. package/dist/utils/languages.js +2 -1
  7. package/dist/utils/languages.js.map +1 -1
  8. package/dist/utils/namespaces.js +3 -2
  9. package/dist/utils/namespaces.js.map +1 -1
  10. package/dist/utils/own-value.d.ts +1 -0
  11. package/dist/utils/own-value.js +9 -0
  12. package/dist/utils/own-value.js.map +1 -0
  13. package/dist/utils/registry.js +2 -1
  14. package/dist/utils/registry.js.map +1 -1
  15. package/dist/utils/resolve.js +8 -3
  16. package/dist/utils/resolve.js.map +1 -1
  17. package/dist/utils/review.js +3 -2
  18. package/dist/utils/review.js.map +1 -1
  19. package/dist/utils/tree.js +1 -1
  20. package/dist/utils/tree.js.map +1 -1
  21. package/frontend-vue/.prettierignore +1 -0
  22. package/frontend-vue/app/build/components/KeyAddModal.vue +3 -2
  23. package/frontend-vue/app/build/components/KeyEditorDrawer.vue +12 -11
  24. package/frontend-vue/app/build/components/LanguagePicker.vue +2 -2
  25. package/frontend-vue/app/build/components/LocaleTile.vue +1 -1
  26. package/frontend-vue/app/build/components/PlaceholderText.vue +1 -1
  27. package/frontend-vue/app/build/components/WorkspaceRenameModal.vue +2 -2
  28. package/frontend-vue/app/build/components/matrix/MatrixCell.vue +1 -1
  29. package/frontend-vue/app/build/components/matrix/MatrixColumns.vue +1 -1
  30. package/frontend-vue/app/build/components/matrix/MatrixKeyCell.vue +2 -2
  31. package/frontend-vue/app/build/components/queue/QueueDone.vue +2 -1
  32. package/frontend-vue/app/build/components/queue/QueueEditor.vue +2 -2
  33. package/frontend-vue/app/build/components/queue/QueueHeader.vue +2 -1
  34. package/frontend-vue/app/build/composables/useCellMoves.ts +2 -1
  35. package/frontend-vue/app/build/composables/useCellSaves.ts +8 -3
  36. package/frontend-vue/app/build/composables/useKeyPanel.ts +7 -3
  37. package/frontend-vue/app/build/composables/useKeySaves.ts +9 -6
  38. package/frontend-vue/app/build/composables/useQueueToasts.ts +2 -1
  39. package/frontend-vue/app/build/drawer/KeyLanguageField.vue +1 -1
  40. package/frontend-vue/app/build/matrix/MatrixLanguageHeader.vue +1 -1
  41. package/frontend-vue/app/components/NamespaceCoverage.vue +9 -5
  42. package/frontend-vue/app/components/TranslationMatrix.vue +12 -8
  43. package/frontend-vue/app/components/WorkspaceGeneral.vue +1 -1
  44. package/frontend-vue/app/components/WorkspaceList.vue +2 -2
  45. package/frontend-vue/app/components/WorkspaceScope.vue +3 -3
  46. package/frontend-vue/app/composables/translation/useLanguageQueue.ts +5 -3
  47. package/frontend-vue/app/composables/translation/useQueueSession.ts +2 -1
  48. package/frontend-vue/app/composables/translation/useWorkspaceTypes.ts +7 -3
  49. package/frontend-vue/app/utils/ownValue.ts +9 -0
  50. package/frontend-vue/app/utils/queuePass.ts +5 -1
  51. package/frontend-vue/app/utils/translations.ts +3 -2
  52. package/frontend-vue/eslint.config.mjs +1 -1
  53. package/frontend-vue/package.json +9 -9
  54. package/frontend-vue/tsconfig.json +2 -1
  55. package/package.json +16 -16
@@ -96,7 +96,8 @@ function failureExpected(
96
96
  outcome: KeyWriteFailed,
97
97
  ): ExpectedText {
98
98
  const { current, kind } = outcome.failure
99
- const isOverwritable = kind === 'conflict' && address.code in current
99
+ const isOverwritable =
100
+ kind === 'conflict' && Object.hasOwn(current, address.code)
100
101
  return isOverwritable
101
102
  ? savedText(current[address.code])
102
103
  : outcome.expected[address.code]
@@ -209,7 +210,10 @@ function useCellView(
209
210
  store.failures.value[idOfCell(address)],
210
211
  isPending(address: CellAddress): boolean {
211
212
  const id = idOfCell(address)
212
- return id in store.pending.value || id in store.failures.value
213
+ return (
214
+ Object.hasOwn(store.pending.value, id) ||
215
+ Object.hasOwn(store.failures.value, id)
216
+ )
213
217
  },
214
218
  /** A text of the row that could not be saved: the row is not done. */
215
219
  hasRowFailure: (workspace: string, key: string): boolean =>
@@ -252,7 +256,8 @@ function changedElsewhere(
252
256
  row: FlatTranslationRow | undefined,
253
257
  ): string | undefined {
254
258
  const id = idOfCell(address)
255
- if (!starts.has(id) || id in store.pending.value || !row) return undefined
259
+ if (!starts.has(id) || Object.hasOwn(store.pending.value, id) || !row)
260
+ return undefined
256
261
  const current = savedText(row.values[address.code])
257
262
  return current === starts.of(id) ? undefined : (current ?? '')
258
263
  }
@@ -1,3 +1,4 @@
1
+ import { ownValue } from '../../utils/ownValue.ts'
1
2
  import type { Ref } from 'vue'
2
3
  import { useDmsRouter, useDmsState } from '#dms/frontend-module'
3
4
  import type { DrawerRowHeader } from '#dms-ui/app/composables/containers/types'
@@ -142,8 +143,10 @@ function seed(
142
143
  }
143
144
 
144
145
  function dropSeed(context: PanelContext, key: string) {
145
- const { [key]: dropped, ...rest } = context.seeds.value
146
- if (dropped) context.seeds.value = rest
146
+ if (!ownValue(context.seeds.value, key)) return
147
+ context.seeds.value = Object.fromEntries(
148
+ Object.entries(context.seeds.value).filter(([seed]) => seed !== key),
149
+ )
147
150
  }
148
151
 
149
152
  function propsFor(context: PanelContext, request: PanelRequest) {
@@ -252,7 +255,8 @@ function onClosed(context: PanelContext) {
252
255
 
253
256
  function isOpenable(context: PanelContext, key: string): boolean {
254
257
  const { options } = context
255
- if (context.seeds.value[key] || options.isKnown?.(key) !== false) return true
258
+ if (ownValue(context.seeds.value, key) || options.isKnown?.(key) !== false)
259
+ return true
256
260
  options.onUnknown?.(key)
257
261
  return false
258
262
  }
@@ -1,3 +1,4 @@
1
+ import { ownValue } from '../../utils/ownValue.ts'
1
2
  import type { Ref } from 'vue'
2
3
  import type { FlatTranslationRow, KeyRowResponse } from '../../types/lang'
3
4
  import {
@@ -161,7 +162,9 @@ function queueWrite(
161
162
  const texts = codes.map((code) => ({
162
163
  id: saveIdOf(request.workspace, request.key, code),
163
164
  text: request.values[code],
164
- expected: request.expected[code],
165
+ expected: Object.hasOwn(request.expected, code)
166
+ ? request.expected[code]
167
+ : undefined,
165
168
  }))
166
169
  const sendCarried = (expected: ExpectedText[]) =>
167
170
  send(
@@ -278,7 +281,7 @@ export function useBaseClearQuestion() {
278
281
  /** The save state of each text of a set, a save flashing "Saved" for a moment. */
279
282
  export function useSaveStates(states: Ref<Record<string, SaveState>>) {
280
283
  function stateOf(id: string): SaveState {
281
- return states.value[id] ?? 'idle'
284
+ return ownValue(states.value, id) ?? 'idle'
282
285
  }
283
286
 
284
287
  function setState(id: string, state: SaveState) {
@@ -288,7 +291,7 @@ export function useSaveStates(states: Ref<Record<string, SaveState>>) {
288
291
  function flashSaved(id: string) {
289
292
  setState(id, 'saved')
290
293
  setTimeout(() => {
291
- if (states.value[id] === 'saved') setState(id, 'idle')
294
+ if (ownValue(states.value, id) === 'saved') setState(id, 'idle')
292
295
  }, SAVED_FLASH_MS)
293
296
  }
294
297
 
@@ -300,11 +303,11 @@ export function useEditStarts() {
300
303
  const starts = ref<Record<string, ExpectedText>>({})
301
304
 
302
305
  return {
303
- has: (id: string) => id in starts.value,
304
- of: (id: string): ExpectedText => starts.value[id],
306
+ has: (id: string) => Object.hasOwn(starts.value, id),
307
+ of: (id: string): ExpectedText => ownValue(starts.value, id),
305
308
  /** Remembers what a text shows as its edit begins (once per edit). */
306
309
  begin(id: string, text: ExpectedText) {
307
- if (!(id in starts.value))
310
+ if (!Object.hasOwn(starts.value, id))
308
311
  starts.value = withEntry(starts.value, id, text)
309
312
  },
310
313
  set(id: string, text: ExpectedText) {
@@ -64,7 +64,8 @@ function announceDeleted(context: ToastContext, key: string, draftText = '') {
64
64
  }
65
65
 
66
66
  function showStep({ t, toast }: ToastContext, step: QueueStep | undefined) {
67
- const title = step ? STEP_TOASTS[step] : undefined
67
+ const title =
68
+ step && Object.hasOwn(STEP_TOASTS, step) ? STEP_TOASTS[step] : undefined
68
69
  if (!title) return
69
70
  toast.add({ title: t(title), color: 'neutral', icon: 'i-ph-arrow-u-up-left' })
70
71
  }
@@ -167,7 +167,7 @@ const props = defineProps<{
167
167
  />
168
168
  <div
169
169
  v-else
170
- class="border-default bg-(--dms-bg-muted) rounded-md border px-3 py-2 text-sm"
170
+ class="border-default rounded-md border bg-(--dms-bg-muted) px-3 py-2 text-sm"
171
171
  >
172
172
  <PlaceholderText
173
173
  v-if="draftOf(code)"
@@ -30,7 +30,7 @@ defineProps<{
30
30
  />
31
31
  <span
32
32
  v-else
33
- class="text-dimmed ml-auto whitespace-nowrap font-mono text-[10.5px]"
33
+ class="text-dimmed ml-auto font-mono text-[10.5px] whitespace-nowrap"
34
34
  >
35
35
  {{
36
36
  $t(
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { ownValue } from '../utils/ownValue.ts'
2
3
  import { useFirstRun } from '../composables/translation/useFirstRun'
3
4
  import { LANG_API } from '../composables/translation/useI18nWorkspaces'
4
5
  import { useLangFormat } from '../composables/translation/useLangFormat'
@@ -55,11 +56,14 @@ const neediestMissing = computed(
55
56
  )
56
57
 
57
58
  function shownCoverage(entry: NamespaceRow, code: string): number {
58
- return coveragePercent(entry.keys - (entry.missing[code] ?? 0), entry.keys)
59
+ return coveragePercent(
60
+ entry.keys - (ownValue(entry.missing, code) ?? 0),
61
+ entry.keys,
62
+ )
59
63
  }
60
64
 
61
65
  function cellLink(entry: NamespaceRow, code: string): string {
62
- if (!entry.missing[code]) {
66
+ if (!ownValue(entry.missing, code)) {
63
67
  return links.translations({ namespace: entry.namespace })
64
68
  }
65
69
  return links.translations({
@@ -70,7 +74,7 @@ function cellLink(entry: NamespaceRow, code: string): string {
70
74
  }
71
75
 
72
76
  function cellLabel(entry: NamespaceRow, code: string): string {
73
- const missing = entry.missing[code] ?? 0
77
+ const missing = ownValue(entry.missing, code) ?? 0
74
78
  const params = {
75
79
  namespace: entry.namespace,
76
80
  name: nameAmong(code, targets.value),
@@ -148,7 +152,7 @@ usePageHeaderActions(() => [
148
152
 
149
153
  <div
150
154
  v-else
151
- class="overflow-x-auto px-4 pb-4 pt-3"
155
+ class="overflow-x-auto px-4 pt-3 pb-4"
152
156
  >
153
157
  <div
154
158
  class="grid items-center gap-1.5"
@@ -183,7 +187,7 @@ usePageHeaderActions(() => [
183
187
  v-for="code in locales"
184
188
  :key="code"
185
189
  :to="cellLink(entry, code)"
186
- class="grid h-8 place-items-center rounded-md font-mono text-xs font-semibold ring-1 ring-inset transition-opacity hover:opacity-80"
190
+ class="grid h-8 place-items-center rounded-md font-mono text-xs font-semibold ring-1 transition-opacity ring-inset hover:opacity-80"
187
191
  :class="HEAT_CLASSES[coverageTone(shownCoverage(entry, code))]"
188
192
  :title="cellLabel(entry, code)"
189
193
  :aria-label="cellLabel(entry, code)"
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { ownValue } from '../utils/ownValue.ts'
2
3
  import {
3
4
  DEFAULT_WORKSPACE,
4
5
  useI18nWorkspaces,
@@ -194,7 +195,10 @@ function pin(key: string) {
194
195
 
195
196
  function rowValue(row: FlatTranslationRow | undefined, code: string): string {
196
197
  return row
197
- ? saves.shownValue(at(row.key, code), stringValue(row.values[code]))
198
+ ? saves.shownValue(
199
+ at(row.key, code),
200
+ stringValue(ownValue(row.values, code)),
201
+ )
198
202
  : ''
199
203
  }
200
204
 
@@ -264,7 +268,7 @@ async function overrideKey(row: FlatTranslationRow) {
264
268
 
265
269
  function inheritedOf(row: FlatTranslationRow, code: string) {
266
270
  if (!isDefault.value || !row.inherited) return undefined
267
- return stringValue(row.inherited[code]) || undefined
271
+ return stringValue(ownValue(row.inherited, code)) || undefined
268
272
  }
269
273
 
270
274
  function cellProps(row: FlatTranslationRow, column: LanguageCoverage) {
@@ -463,7 +467,7 @@ onBeforeUnmount(() => {
463
467
  v-for="group in view.rendered.value"
464
468
  :key="group.namespace"
465
469
  >
466
- <div class="border-default bg-(--dms-bg-muted) border-b px-4 py-2">
470
+ <div class="border-default border-b bg-(--dms-bg-muted) px-4 py-2">
467
471
  <MatrixGroupHeader
468
472
  :namespace="group.namespace"
469
473
  :keys="group.keys"
@@ -539,10 +543,10 @@ onBeforeUnmount(() => {
539
543
  :class="todoLanguage ? 'w-[28rem]' : 'w-60'"
540
544
  />
541
545
  </colgroup>
542
- <thead class="bg-(--dms-surface-card) sticky top-0 z-20">
546
+ <thead class="sticky top-0 z-20 bg-(--dms-surface-card)">
543
547
  <tr>
544
548
  <th
545
- class="border-default bg-(--dms-surface-card) sticky left-0 z-10 border-b border-r px-4 py-2.5 text-left shadow-[4px_0_6px_-4px_rgb(0_0_0/0.25)]"
549
+ class="border-default sticky left-0 z-10 border-r border-b bg-(--dms-surface-card) px-4 py-2.5 text-left shadow-[4px_0_6px_-4px_rgb(0_0_0/0.25)]"
546
550
  >
547
551
  <DmsEyebrowLabel
548
552
  :label="$t('dms_lang.matrix.key')"
@@ -552,7 +556,7 @@ onBeforeUnmount(() => {
552
556
  <th
553
557
  v-for="column in columns"
554
558
  :key="column.code"
555
- class="border-default border-b border-l px-3 pb-0 pt-2.5 text-left font-normal"
559
+ class="border-default border-b border-l px-3 pt-2.5 pb-0 text-left font-normal"
556
560
  >
557
561
  <MatrixLanguageHeader
558
562
  :column="column"
@@ -569,7 +573,7 @@ onBeforeUnmount(() => {
569
573
  <tr>
570
574
  <td
571
575
  :colspan="columns.length + 1"
572
- class="border-default bg-(--dms-bg-muted) border-b py-1.5"
576
+ class="border-default border-b bg-(--dms-bg-muted) py-1.5"
573
577
  >
574
578
  <div class="sticky left-0 inline-block px-4">
575
579
  <MatrixGroupHeader
@@ -588,7 +592,7 @@ onBeforeUnmount(() => {
588
592
  class="group/row align-top"
589
593
  >
590
594
  <td
591
- class="border-default group-hover/row:bg-elevated/30 bg-(--dms-surface-card) sticky left-0 z-10 border-b border-r px-4 py-2.5 shadow-[4px_0_6px_-4px_rgb(0_0_0/0.25)]"
595
+ class="border-default group-hover/row:bg-elevated/30 sticky left-0 z-10 border-r border-b bg-(--dms-surface-card) px-4 py-2.5 shadow-[4px_0_6px_-4px_rgb(0_0_0/0.25)]"
592
596
  >
593
597
  <MatrixKeyCell
594
598
  :row-key="row.key"
@@ -146,7 +146,7 @@ usePageHeaderActions(() =>
146
146
  :label="$t('dms_lang.workspace.source_label')"
147
147
  :description="$t(`dms_lang.workspace.source_help_${kind}`)"
148
148
  >
149
- <code class="text-muted break-all font-mono text-xs">
149
+ <code class="text-muted font-mono text-xs break-all">
150
150
  {{ $t(`dms_lang.workspace_kinds.${kind}.folder`) }}
151
151
  </code>
152
152
  </DmsFieldRow>
@@ -378,7 +378,7 @@ watch(
378
378
  <span
379
379
  v-for="code in localeCodes(workspace)"
380
380
  :key="code"
381
- class="border-default inline-flex items-center gap-1.5 rounded-md border py-0.5 pl-0.5 pr-2 font-mono text-xs"
381
+ class="border-default inline-flex items-center gap-1.5 rounded-md border py-0.5 pr-2 pl-0.5 font-mono text-xs"
382
382
  >
383
383
  <LocaleTile
384
384
  :code="code"
@@ -451,7 +451,7 @@ watch(
451
451
  <button
452
452
  v-if="isLoaded && canCreate"
453
453
  type="button"
454
- class="border-default text-muted hover:border-primary/50 hover:text-highlighted rounded-(--dms-radius-card) flex min-h-56 flex-col items-center justify-center gap-3 border border-dashed p-6 text-center transition-colors"
454
+ class="border-default text-muted hover:border-primary/50 hover:text-highlighted flex min-h-56 flex-col items-center justify-center gap-3 rounded-(--dms-radius-card) border border-dashed p-6 text-center transition-colors"
455
455
  @click="create"
456
456
  >
457
457
  <DmsIconWell
@@ -198,7 +198,7 @@ watch(
198
198
  class="space-y-3"
199
199
  >
200
200
  <div
201
- class="dms-card flex flex-wrap items-center gap-x-3.5 gap-y-2.5 py-2 pl-2 pr-3.5"
201
+ class="dms-card flex flex-wrap items-center gap-x-3.5 gap-y-2.5 py-2 pr-3.5 pl-2"
202
202
  >
203
203
  <UDropdownMenu
204
204
  :items="menuItems"
@@ -231,7 +231,7 @@ watch(
231
231
  </template>
232
232
  <button
233
233
  type="button"
234
- class="hover:bg-elevated/60 hover:border-default flex h-11 items-center gap-2.5 rounded-md border border-transparent pl-1.5 pr-2.5 text-left transition-colors"
234
+ class="hover:bg-elevated/60 hover:border-default flex h-11 items-center gap-2.5 rounded-md border border-transparent pr-2.5 pl-1.5 text-left transition-colors"
235
235
  :aria-label="$t('dms_lang.scope.switch')"
236
236
  >
237
237
  <DmsIconWell
@@ -250,7 +250,7 @@ watch(
250
250
  />
251
251
  <span
252
252
  v-else
253
- class="text-highlighted text-sm font-semibold leading-tight"
253
+ class="text-highlighted text-sm leading-tight font-semibold"
254
254
  >
255
255
  {{ workspaceLabel(current) }}
256
256
  </span>
@@ -1,3 +1,4 @@
1
+ import { ownValue } from '../../utils/ownValue.ts'
1
2
  import type { ComputedRef } from 'vue'
2
3
  import { useDmsRouter } from '#dms/frontend-module'
3
4
  import type { FlatTranslationRow, FlatTranslations } from '../../types/lang'
@@ -91,8 +92,8 @@ function progressOf(flat: FlatTranslations, locale: string) {
91
92
  return namespaceCoverage(flat.rows, [locale])
92
93
  .map((entry) => ({
93
94
  namespace: entry.namespace,
94
- coverage: entry.coverage[locale] ?? 0,
95
- missing: entry.missing[locale] ?? 0,
95
+ coverage: ownValue(entry.coverage, locale) ?? 0,
96
+ missing: ownValue(entry.missing, locale) ?? 0,
96
97
  }))
97
98
  .sort(
98
99
  (left, right) =>
@@ -160,7 +161,8 @@ function queueFacts(
160
161
  checks: RowChecks,
161
162
  scoped: ComputedRef<FlatTranslationRow[]>,
162
163
  ) {
163
- const missingOf = (code: string) => flat.value.localeMissing[code] ?? 0
164
+ const missingOf = (code: string) =>
165
+ ownValue(flat.value.localeMissing, code) ?? 0
164
166
  return {
165
167
  isBase: computed(() => locale.value === flat.value.defaultLocale),
166
168
  /** The languages to translate besides this one, the least complete first. */
@@ -1,3 +1,4 @@
1
+ import { ownValue } from '../../utils/ownValue.ts'
1
2
  import type { ComputedRef, Ref } from 'vue'
2
3
  import type { FlatTranslationRow } from '../../types/lang'
3
4
  import { savedText } from '../../utils/keySaves'
@@ -46,7 +47,7 @@ function passView(
46
47
  const key = currentKey(pass.value)
47
48
  return key === undefined ? undefined : rowsByKey.value.get(key)
48
49
  })
49
- const statusOf = (key: string) => pass.value.status[key]
50
+ const statusOf = (key: string) => ownValue(pass.value.status, key)
50
51
  const upNext = computed<QueueEntry[]>(() =>
51
52
  pendingAfter(pass.value, pass.value.cursor, isOpen)
52
53
  .slice(0, upNextSize)
@@ -15,6 +15,10 @@ const KIND_ICONS: Record<WorkspaceKind, string> = {
15
15
  modules: 'i-ph-puzzle-piece',
16
16
  }
17
17
 
18
+ function iconOf(icons: Record<string, string>, key: string): string {
19
+ return Object.hasOwn(icons, key) ? icons[key] : ''
20
+ }
21
+
18
22
  function isWorkspaceType(value: unknown): value is WorkspaceType {
19
23
  return typeof value === 'string' && Object.hasOwn(TYPE_ICONS, value)
20
24
  }
@@ -28,10 +32,10 @@ export const useWorkspaceTypes = () => {
28
32
  .map((value) => ({
29
33
  value,
30
34
  label: t(`dms_lang.workspace_types.${value}`),
31
- icon: TYPE_ICONS[value],
35
+ icon: iconOf(TYPE_ICONS, value),
32
36
  })),
33
37
  )
34
- const typeIcon = (type: WorkspaceType) => TYPE_ICONS[type]
38
+ const typeIcon = (type: WorkspaceType) => iconOf(TYPE_ICONS, type)
35
39
  const typeOf = (value: unknown): WorkspaceType | undefined =>
36
40
  isWorkspaceType(value) ? value : undefined
37
41
  const typeLabel = (type: WorkspaceType) =>
@@ -41,7 +45,7 @@ export const useWorkspaceTypes = () => {
41
45
  typeIcon,
42
46
  typeLabel,
43
47
  typeOf,
44
- kindIcon: (kind: WorkspaceKind) => KIND_ICONS[kind],
48
+ kindIcon: (kind: WorkspaceKind) => iconOf(KIND_ICONS, kind),
45
49
  descriptionMax: WORKSPACE_DESCRIPTION_MAX,
46
50
  }
47
51
  }
@@ -0,0 +1,9 @@
1
+ /** The value `table` holds under `key` itself, never one inherited from `Object.prototype`. */
2
+ export function ownValue<V>(
3
+ table: Readonly<Record<string, V>> | undefined,
4
+ key: string,
5
+ ): V | undefined {
6
+ return table !== undefined && Object.hasOwn(table, key)
7
+ ? table[key]
8
+ : undefined
9
+ }
@@ -47,7 +47,11 @@ export function isPendingKey(
47
47
  key: string | undefined,
48
48
  isOpen: KeyIsOpen,
49
49
  ): boolean {
50
- if (key === undefined || pass.status[key] === 'done') return false
50
+ if (
51
+ key === undefined ||
52
+ (Object.hasOwn(pass.status, key) && pass.status[key] === 'done')
53
+ )
54
+ return false
51
55
  return isOpen(key)
52
56
  }
53
57
 
@@ -1,3 +1,4 @@
1
+ import { ownValue } from './ownValue.ts'
1
2
  import { baseCompile, CompileErrorCodes } from '@intlify/message-compiler'
2
3
  import type { FlatTranslationRow, TranslationValue } from '../types/lang'
3
4
 
@@ -136,8 +137,8 @@ export function isRowValueMissing(
136
137
  locale: string,
137
138
  ): boolean {
138
139
  return (
139
- isLocaleValueMissing(row.values[locale]) &&
140
- isLocaleValueMissing(row.inherited?.[locale])
140
+ isLocaleValueMissing(ownValue(row.values, locale)) &&
141
+ isLocaleValueMissing(ownValue(row.inherited, locale))
141
142
  )
142
143
  }
143
144
 
@@ -8,7 +8,7 @@ import globals from 'globals'
8
8
  * elements self-close the way Prettier writes them.
9
9
  */
10
10
  export default antelopeNuxtConfig()
11
- .append({ ignores: ['.dms-types/**'] })
11
+ .append({ ignores: ['.dms-types/**', '.dms-types.next/**'] })
12
12
  .append({
13
13
  files: ['**/*.{js,mjs,cjs,ts,vue}'],
14
14
  languageOptions: {
@@ -5,7 +5,7 @@
5
5
  "type": "module",
6
6
  "main": "./dms.frontend.ts",
7
7
  "license": "Apache-2.0",
8
- "packageManager": "pnpm@10.6.5",
8
+ "packageManager": "pnpm@10.34.9",
9
9
  "engines": {
10
10
  "@antelopejs/dms-frontend": ">=0.11.4 <0.12.0"
11
11
  },
@@ -19,21 +19,21 @@
19
19
  "lint:fix": "eslint . --fix"
20
20
  },
21
21
  "devDependencies": {
22
- "@antelopejs/core": "~1.24.7",
23
- "@antelopejs/dms": ">=0.24.0 <0.25.0",
24
- "@antelopejs/dms-frontend": ">=0.11.8 <0.12.0",
25
- "@antelopejs/tooling-configs": ">=0.10.0 <0.11.0",
22
+ "@antelopejs/core": "~1.25.0",
23
+ "@antelopejs/dms": ">=0.25.7 <0.26.0",
24
+ "@antelopejs/dms-frontend": ">=0.11.16 <0.12.0",
25
+ "@antelopejs/tooling-configs": "^0.10.18",
26
26
  "@nuxt/eslint-config": "^1.17.0",
27
- "@vueuse/core": "^14.4.0",
28
- "eslint": "^9",
27
+ "@vueuse/core": "^15.0.0",
28
+ "eslint": "^10.0.0",
29
29
  "globals": "^15",
30
30
  "prettier": "^3.5.3",
31
- "prettier-plugin-tailwindcss": "^0.6.11",
31
+ "prettier-plugin-tailwindcss": "^0.8.0",
32
32
  "typescript": "^6.0.3",
33
33
  "vue": "^3.5.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "@nuxt/ui": "4.10.0",
36
+ "@nuxt/ui": "4.13.1",
37
37
  "@vueuse/core": "^14.4.0",
38
38
  "vue": "^3.5.0"
39
39
  },
@@ -1,6 +1,7 @@
1
1
  {
2
+ "antelopejs": { "editorOnly": true },
2
3
  "extends": "./.dms-types/tsconfig.json",
3
- "compilerOptions": { "allowJs": true },
4
+ "compilerOptions": { "allowJs": true, "moduleDetection": "force" },
4
5
  "include": ["./**/*.ts", "./**/*.vue", "./eslint.config.mjs"],
5
6
  "exclude": ["./node_modules", "./.dms-types"]
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/dms-lang",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Language and translation management for the AntelopeJS DMS: coverage overview, translation matrix, translation queue and public translation workspaces.",
5
5
  "keywords": [
6
6
  "antelopejs",
@@ -41,21 +41,21 @@
41
41
  "registry": "https://registry.npmjs.org/"
42
42
  },
43
43
  "dependencies": {
44
- "@antelopejs/interface-api": ">=0.3.4 <0.4.0",
44
+ "@antelopejs/interface-api": ">=0.3.5 <0.4.0",
45
45
  "@antelopejs/interface-core": ">=0.5.2 <0.6.0",
46
- "@antelopejs/interface-dms": ">=0.17.0 <0.18.0",
46
+ "@antelopejs/interface-dms": ">=0.17.4 <0.18.0",
47
47
  "@intlify/message-compiler": "^11.1.12",
48
48
  "zod": "^4.5.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@antelopejs/api": "~1.7.5",
52
- "@antelopejs/core": "~1.24.7",
53
- "@antelopejs/dms": ">=0.24.0 <0.25.0",
54
- "@antelopejs/dms-frontend": ">=0.11.8 <0.12.0",
51
+ "@antelopejs/api": "~1.7.11",
52
+ "@antelopejs/core": "~1.25.0",
53
+ "@antelopejs/dms": ">=0.25.7 <0.26.0",
54
+ "@antelopejs/dms-frontend": ">=0.11.16 <0.12.0",
55
55
  "@antelopejs/interface-data-api": ">=0.8.2 <0.9.0",
56
- "@antelopejs/interface-database": ">=0.4.3 <0.5.0",
56
+ "@antelopejs/interface-database": ">=0.4.5 <0.5.0",
57
57
  "@antelopejs/interface-database-decorators": ">=0.5.4 <0.6.0",
58
- "@antelopejs/tooling-configs": ">=0.10.0 <0.11.0",
58
+ "@antelopejs/tooling-configs": "^0.10.18",
59
59
  "@playwright/test": "~1.65.0",
60
60
  "@types/chai": "^5.2.3",
61
61
  "@types/mocha": "^10.0.10",
@@ -67,9 +67,9 @@
67
67
  "mocha": "^12.0.0",
68
68
  "mongodb-memory-server": "^11.3.0",
69
69
  "mongodb-memory-server-core": "^11.2.0",
70
- "oxfmt": "^0.66.0",
71
- "oxlint": "1.81.0",
72
- "oxlint-tsgolint": "^7.0.2001",
70
+ "oxfmt": "^0.80.0",
71
+ "oxlint": "1.95.0",
72
+ "oxlint-tsgolint": "^7.0.2009",
73
73
  "pixelmatch": "^8.0.0",
74
74
  "playwright-core": "^1.65.1",
75
75
  "release-it": "^19.2.4",
@@ -91,7 +91,7 @@
91
91
  }
92
92
  },
93
93
  "dmsFrontend": "dist/frontend-module.js",
94
- "gitHead": "b7b2245dd001d5f799f5a17719f9ac58e41cd94c",
94
+ "gitHead": "542e9e05516a977df1ea24b4facb907313544514",
95
95
  "scripts": {
96
96
  "build": "rimraf dist && tsc",
97
97
  "dev:frontend": "pnpm --dir playground frontend:dev",
@@ -100,10 +100,10 @@
100
100
  "e2e": "playwright test -c e2e",
101
101
  "lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt . && pnpm --dir frontend-vue lint:fix",
102
102
  "lint": "ajs dms prepare-types --out frontend-vue/.dms-types --quiet && oxlint && pnpm --dir frontend-vue lint && node node_modules/@antelopejs/dms/frontend-vue/scripts/check-api-error-presentation.mjs frontend-vue/app playground/frontend-vue && node scripts/check-locales.mts && node scripts/check-dms-versions.mjs",
103
- "typecheck": "tsc --noEmit",
103
+ "typecheck": "tsc --noEmit && tsc --noEmit -p docs/tsconfig.json && tsc --noEmit -p e2e/playground/tsconfig.json && tsc --noEmit -p playground/tsconfig.config.json && tsc --noEmit -p tests/key-writes/tsconfig.json && tsc --noEmit -p tests/key-writes/product/tsconfig.json",
104
104
  "format": "oxfmt . && pnpm --dir frontend-vue format",
105
- "test": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && DMS_PREBUILT=1 ajs module test . && node --test tests/*.test.mjs",
106
- "test:unit": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && mocha dist/test/locale-discovery.test.js dist/test/write-target.test.js && node --test tests/*.test.mjs",
105
+ "test": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && DMS_PREBUILT=1 ajs module test . --timeout 30000 && node --test tests/*.test.mjs",
106
+ "test:unit": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && mocha dist/test/locale-discovery.test.js dist/test/write-target.test.js --timeout 30000 && node --test tests/*.test.mjs",
107
107
  "test:node": "[ -n \"$DMS_PREBUILT\" ] || pnpm run build && node --test tests/*.test.mjs",
108
108
  "test:frontend": "ajs dms verify-source --layer node_modules/@antelopejs/dms/frontend-vue --module frontend-vue",
109
109
  "release": "pnpm run typecheck && pnpm run lint && pnpm run format:check && release-it",