@motor-cms/ui-admin 2.0.0 → 3.0.0

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.
@@ -41,13 +41,6 @@ function onFinish() {
41
41
  return
42
42
  }
43
43
  markAdminGridDone()
44
- // commitDone() before the API call — the browser may cancel the in-flight
45
- // request if the user reloads before it resolves, and the localStorage flag
46
- // must already be present to prevent DashboardOnboarding from resetting
47
- // state and restarting the tour when the dashboard remounts after the
48
- // builder tour redirects back to '/'.
49
- commitDone()
50
- completeOnboarding().catch(() => {})
51
44
  setPending('builder-pages')
52
45
  router.push('/motor-builder/builder-pages')
53
46
  }
@@ -14,6 +14,19 @@ const { fields, schema, groups, state, loading, fetching, fetchError, canWrite,
14
14
  mode: 'edit',
15
15
  id: route.params.id as string
16
16
  })
17
+
18
+ const isoField = fields.find(f => f.key === 'iso_639_1')
19
+ watch(() => state.iso_639_1, (code) => {
20
+ const opt = isoField?.staticOptions?.find(o => o.value === code)
21
+ if (opt) {
22
+ const match = opt.label.match(/^(.+?)\s*—\s*(.+?)\s*\(/)
23
+ state.english_name = match?.[1]?.trim() ?? ''
24
+ state.native_name = match?.[2]?.trim() ?? ''
25
+ } else {
26
+ state.english_name = ''
27
+ state.native_name = ''
28
+ }
29
+ })
17
30
  </script>
18
31
 
19
32
  <template>
@@ -13,6 +13,19 @@ const { fields, schema, groups, state, loading, formRef, onSubmit, onSaveAndNew
13
13
  formConfig: languageFormConfig,
14
14
  mode: 'create'
15
15
  })
16
+
17
+ const isoField = fields.find(f => f.key === 'iso_639_1')
18
+ watch(() => state.iso_639_1, (code) => {
19
+ const opt = isoField?.staticOptions?.find(o => o.value === code)
20
+ if (opt) {
21
+ const match = opt.label.match(/^(.+?)\s*—\s*(.+?)\s*\(/)
22
+ state.english_name = match?.[1]?.trim() ?? ''
23
+ state.native_name = match?.[2]?.trim() ?? ''
24
+ } else {
25
+ state.english_name = ''
26
+ state.native_name = ''
27
+ }
28
+ })
16
29
  </script>
17
30
 
18
31
  <template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motor-cms/ui-admin",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -20,7 +20,7 @@
20
20
  "zod": "^4.0.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@motor-cms/ui-core": ">=2.0.0",
23
+ "@motor-cms/ui-core": ">=3.0.0",
24
24
  "nuxt": "^4.0.0",
25
25
  "vue": "^3.5.0"
26
26
  }