@stonecrop/desktop 0.13.4 → 0.13.6
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/dist/desktop.css +1 -1
- package/dist/desktop.js +1784 -1787
- package/dist/desktop.js.map +1 -1
- package/package.json +11 -14
- package/src/components/CommandPalette.vue +4 -4
- package/src/components/Desktop.vue +13 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/desktop",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -32,36 +32,32 @@
|
|
|
32
32
|
"**/*.css"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@stonecrop/
|
|
36
|
-
"@stonecrop/
|
|
37
|
-
"@stonecrop/
|
|
38
|
-
"@stonecrop/
|
|
39
|
-
"@stonecrop/
|
|
35
|
+
"@stonecrop/aform": "0.13.6",
|
|
36
|
+
"@stonecrop/atable": "0.13.6",
|
|
37
|
+
"@stonecrop/stonecrop": "0.13.6",
|
|
38
|
+
"@stonecrop/themes": "0.13.6",
|
|
39
|
+
"@stonecrop/schema": "0.13.6"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"vue": "^3.5.33"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@eslint/js": "^10.0.1",
|
|
46
45
|
"@microsoft/api-documenter": "^7.30.5",
|
|
47
46
|
"@miragejs/graphql": "^0.1.13",
|
|
48
47
|
"@rushstack/heft": "^1.2.17",
|
|
49
48
|
"@vitejs/plugin-vue": "^6.0.6",
|
|
50
49
|
"@vitest/coverage-istanbul": "^4.1.5",
|
|
51
50
|
"@vue/test-utils": "^2.4.10",
|
|
52
|
-
"eslint": "^10.3.0",
|
|
53
|
-
"eslint-config-prettier": "^10.1.8",
|
|
54
|
-
"eslint-plugin-vue": "^10.9.0",
|
|
55
|
-
"globals": "^17.6.0",
|
|
56
51
|
"immutable": "^5.1.4",
|
|
57
52
|
"jsdom": "^29.1.1",
|
|
58
53
|
"miragejs": "^0.1.48",
|
|
54
|
+
"oxlint": "1.67.0",
|
|
55
|
+
"oxlint-tsgolint": "0.23.0",
|
|
59
56
|
"pinia": "^3.0.4",
|
|
60
57
|
"typescript": "^6.0.3",
|
|
61
|
-
"typescript-eslint": "^8.59.1",
|
|
62
|
-
"vue": "^3.5.33",
|
|
63
58
|
"vite": "^7.3.2",
|
|
64
59
|
"vitest": "^4.1.5",
|
|
60
|
+
"vue": "^3.5.33",
|
|
65
61
|
"vue-router": "^5.0.6",
|
|
66
62
|
"stonecrop-rig": "0.7.0"
|
|
67
63
|
},
|
|
@@ -76,7 +72,8 @@
|
|
|
76
72
|
"_phase:build": "heft build && vite build && rushx docs",
|
|
77
73
|
"build": "heft build && vite build && rushx docs",
|
|
78
74
|
"docs": "bash ../common/scripts/run-docs.sh desktop",
|
|
79
|
-
"lint": "
|
|
75
|
+
"lint": "oxlint",
|
|
76
|
+
"lint:fix": "oxlint --fix",
|
|
80
77
|
"test": "vitest run --coverage.enabled false",
|
|
81
78
|
"test:watch": "vitest watch",
|
|
82
79
|
"test:coverage": "vitest run --coverage"
|
|
@@ -71,15 +71,15 @@ const inputRef = useTemplateRef('input')
|
|
|
71
71
|
|
|
72
72
|
const results = computed(() => {
|
|
73
73
|
if (!query.value) return []
|
|
74
|
-
const
|
|
75
|
-
return
|
|
74
|
+
const searchResults = search(query.value)
|
|
75
|
+
return searchResults.slice(0, maxResults)
|
|
76
76
|
})
|
|
77
77
|
|
|
78
78
|
// reset search query when modal opens
|
|
79
79
|
watch(
|
|
80
80
|
() => isOpen,
|
|
81
|
-
async
|
|
82
|
-
if (
|
|
81
|
+
async open => {
|
|
82
|
+
if (open) {
|
|
83
83
|
query.value = ''
|
|
84
84
|
selectedIndex.value = 0
|
|
85
85
|
await nextTick()
|
|
@@ -120,7 +120,7 @@ const currentViewData = computed<Record<string, any>>({
|
|
|
120
120
|
// Return a plain shallow copy so AForm mutations don't propagate directly into
|
|
121
121
|
// the HST reactive object, which would bypass field-trigger diffing and cause
|
|
122
122
|
// setupDeepReactivity to fire triggers for all fields on every keystroke.
|
|
123
|
-
return { ...
|
|
123
|
+
return { ...record?.get('') }
|
|
124
124
|
} catch {
|
|
125
125
|
return {}
|
|
126
126
|
}
|
|
@@ -141,7 +141,6 @@ const currentViewData = computed<Record<string, any>>({
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
} catch (error) {
|
|
144
|
-
// eslint-disable-next-line no-console
|
|
145
144
|
console.warn('HST update failed:', error)
|
|
146
145
|
}
|
|
147
146
|
},
|
|
@@ -284,7 +283,6 @@ const getAvailableTransitions = () => {
|
|
|
284
283
|
},
|
|
285
284
|
}))
|
|
286
285
|
} catch (error) {
|
|
287
|
-
// eslint-disable-next-line no-console
|
|
288
286
|
console.warn('Error getting available transitions:', error)
|
|
289
287
|
return []
|
|
290
288
|
}
|
|
@@ -523,12 +521,12 @@ const getRecordsSchema = (): SchemaTypes[] => {
|
|
|
523
521
|
const records = getRecords()
|
|
524
522
|
const idField = props.recordIdField || 'id'
|
|
525
523
|
|
|
526
|
-
const rows = records.map(record =>
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
524
|
+
const rows = records.map(record =>
|
|
525
|
+
Object.assign({}, record, {
|
|
526
|
+
id: record[idField] || record.id || '',
|
|
527
|
+
actions: 'Edit | Delete',
|
|
528
|
+
})
|
|
529
|
+
)
|
|
532
530
|
|
|
533
531
|
return [
|
|
534
532
|
{
|
|
@@ -637,7 +635,6 @@ const getRecordIdFromRow = (rowElement: HTMLTableRowElement): string | null => {
|
|
|
637
635
|
if (!record) return null
|
|
638
636
|
|
|
639
637
|
const idField = props.recordIdField || 'id'
|
|
640
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
641
638
|
return record[idField] || record.id || null
|
|
642
639
|
}
|
|
643
640
|
|
|
@@ -691,7 +688,6 @@ const loadRecordData = async () => {
|
|
|
691
688
|
try {
|
|
692
689
|
await stonecrop.value.getRecord(currentDoctype.value, currentRecordId.value)
|
|
693
690
|
} catch (error) {
|
|
694
|
-
// eslint-disable-next-line no-console
|
|
695
691
|
console.warn('Error fetching record:', error)
|
|
696
692
|
} finally {
|
|
697
693
|
loading.value = false
|
|
@@ -747,16 +743,17 @@ provide('aformLinkNavigator', {
|
|
|
747
743
|
},
|
|
748
744
|
} satisfies AFormLinkNavigator)
|
|
749
745
|
|
|
746
|
+
function toDisplayString(rec: Record<string, unknown> | undefined): string | undefined {
|
|
747
|
+
if (!rec) return undefined
|
|
748
|
+
const val = rec.name ?? rec.title ?? rec.displayText
|
|
749
|
+
return typeof val === 'string' || typeof val === 'number' ? String(val) : undefined
|
|
750
|
+
}
|
|
751
|
+
|
|
750
752
|
// Provide a resolver for AFormLink to look up display text by doctype + id.
|
|
751
753
|
// Checks HST first (sync); falls back to an async client fetch if not cached.
|
|
752
754
|
provide('aformLinkResolver', async (doctypeSlug: string, id: string): Promise<string | undefined> => {
|
|
753
755
|
if (!stonecrop.value) return undefined
|
|
754
756
|
try {
|
|
755
|
-
const toDisplayString = (rec: Record<string, unknown> | undefined): string | undefined => {
|
|
756
|
-
if (!rec) return undefined
|
|
757
|
-
const val = rec.name ?? rec.title ?? rec.displayText
|
|
758
|
-
return typeof val === 'string' || typeof val === 'number' ? String(val) : undefined
|
|
759
|
-
}
|
|
760
757
|
const cached = stonecrop.value.getRecordById(doctypeSlug, id)?.get('') as Record<string, unknown> | undefined
|
|
761
758
|
const cachedDisplay = toDisplayString(cached)
|
|
762
759
|
if (cachedDisplay != null) return cachedDisplay
|