@stonecrop/stonecrop 0.11.7 → 0.11.9
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/{composables → src/composables}/lazy-link.js +1 -1
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/{registry.js → src/registry.js} +6 -4
- package/dist/src/stonecrop.d.ts.map +1 -1
- package/dist/src/stonecrop.js +565 -0
- package/dist/{stores → src/stores}/hst.js +1 -1
- package/dist/src/stores/operation-log.d.ts.map +1 -1
- package/dist/{stores → src/stores}/operation-log.js +1 -1
- package/dist/src/types/doctype.d.ts +2 -2
- package/dist/src/types/doctype.d.ts.map +1 -1
- package/dist/stonecrop.d.ts +2 -1
- package/dist/stonecrop.js +17 -10
- package/dist/stonecrop.js.map +1 -1
- package/dist/stonecrop.tsbuildinfo +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +23 -23
- package/src/composables/lazy-link.ts +1 -1
- package/src/composables/stonecrop.ts +1 -1
- package/src/field-triggers.ts +1 -1
- package/src/registry.ts +10 -7
- package/src/stonecrop.ts +0 -1
- package/src/stores/hst.ts +1 -1
- package/src/stores/operation-log.ts +11 -9
- package/src/types/doctype.ts +2 -2
- /package/dist/{composables → src/composables}/operation-log.js +0 -0
- /package/dist/{composables → src/composables}/stonecrop.js +0 -0
- /package/dist/{doctype.js → src/doctype.js} +0 -0
- /package/dist/{exceptions.js → src/exceptions.js} +0 -0
- /package/dist/{field-triggers.js → src/field-triggers.js} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{plugins → src/plugins}/index.js +0 -0
- /package/dist/{schema-validator.js → src/schema-validator.js} +0 -0
- /package/dist/{stores → src/stores}/index.js +0 -0
- /package/dist/{types → src/types}/composable.js +0 -0
- /package/dist/{types → src/types}/doctype.js +0 -0
- /package/dist/{types → src/types}/field-triggers.js +0 -0
- /package/dist/{types → src/types}/hst.js +0 -0
- /package/dist/{types → src/types}/index.js +0 -0
- /package/dist/{types → src/types}/operation-log.js +0 -0
- /package/dist/{types → src/types}/plugin.js +0 -0
- /package/dist/{types → src/types}/registry.js +0 -0
- /package/dist/{types → src/types}/schema-validator.js +0 -0
- /package/dist/{types → src/types}/stonecrop.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"6.0.3"}
|
package/dist/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/stonecrop",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -34,35 +34,35 @@
|
|
|
34
34
|
"pinia-shared-state": "^1.0.1",
|
|
35
35
|
"pinia-xstate": "^3.0.0",
|
|
36
36
|
"xstate": "^5.25.0",
|
|
37
|
-
"@stonecrop/schema": "0.11.
|
|
37
|
+
"@stonecrop/schema": "0.11.9"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"pinia": "^3.0.4",
|
|
41
|
-
"vue": "^3.5.
|
|
42
|
-
"vue-router": "^5.0.
|
|
41
|
+
"vue": "^3.5.33",
|
|
42
|
+
"vue-router": "^5.0.6"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@eslint/js": "^
|
|
46
|
-
"@microsoft/api-documenter": "^7.
|
|
47
|
-
"@rushstack/heft": "^1.2.
|
|
48
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
49
|
-
"@vitest/coverage-istanbul": "^4.
|
|
50
|
-
"@vue/test-utils": "^2.4.
|
|
51
|
-
"eslint": "^
|
|
45
|
+
"@eslint/js": "^10.0.1",
|
|
46
|
+
"@microsoft/api-documenter": "^7.30.5",
|
|
47
|
+
"@rushstack/heft": "^1.2.17",
|
|
48
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
49
|
+
"@vitest/coverage-istanbul": "^4.1.5",
|
|
50
|
+
"@vue/test-utils": "^2.4.10",
|
|
51
|
+
"eslint": "^10.3.0",
|
|
52
52
|
"eslint-config-prettier": "^10.1.8",
|
|
53
|
-
"eslint-plugin-vue": "^10.
|
|
54
|
-
"globals": "^17.
|
|
55
|
-
"jsdom": "^
|
|
56
|
-
"typescript": "^
|
|
53
|
+
"eslint-plugin-vue": "^10.9.0",
|
|
54
|
+
"globals": "^17.6.0",
|
|
55
|
+
"jsdom": "^29.1.1",
|
|
56
|
+
"typescript": "^6.0.3",
|
|
57
57
|
"pinia": "^3.0.4",
|
|
58
|
-
"typescript-eslint": "^8.
|
|
59
|
-
"vue": "^3.5.
|
|
60
|
-
"vue-router": "^5.0.
|
|
61
|
-
"vite": "^7.3.
|
|
62
|
-
"vitest": "^4.
|
|
63
|
-
"@stonecrop/
|
|
64
|
-
"
|
|
65
|
-
"stonecrop
|
|
58
|
+
"typescript-eslint": "^8.59.1",
|
|
59
|
+
"vue": "^3.5.33",
|
|
60
|
+
"vue-router": "^5.0.6",
|
|
61
|
+
"vite": "^7.3.2",
|
|
62
|
+
"vitest": "^4.1.5",
|
|
63
|
+
"@stonecrop/aform": "0.11.9",
|
|
64
|
+
"stonecrop-rig": "0.7.0",
|
|
65
|
+
"@stonecrop/atable": "0.11.9"
|
|
66
66
|
},
|
|
67
67
|
"description": "Schema-driven framework with XState workflows and HST state management",
|
|
68
68
|
"publishConfig": {
|
|
@@ -74,7 +74,7 @@ export function useLazyLink(doctype: Doctype, recordId: string, linkFieldname: s
|
|
|
74
74
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
75
75
|
return await fn(stonecropInstance, getLinkPath(), hstStore)
|
|
76
76
|
} catch (err) {
|
|
77
|
-
throw new Error(`Custom handler failed: ${err instanceof Error ? err.message : String(err)}
|
|
77
|
+
throw new Error(`Custom handler failed: ${err instanceof Error ? err.message : String(err)}`, { cause: err })
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
package/src/field-triggers.ts
CHANGED
|
@@ -357,7 +357,7 @@ export class FieldTriggerEngine {
|
|
|
357
357
|
const regularActionFn = this.globalActions.get(actionName)
|
|
358
358
|
if (regularActionFn) {
|
|
359
359
|
// Wrap regular action to accept TransitionChangeContext
|
|
360
|
-
actionFn = regularActionFn
|
|
360
|
+
actionFn = regularActionFn
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
|
package/src/registry.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaTypes, TableSchema } from '@stonecrop/aform'
|
|
2
|
-
import type { LinkDeclaration } from '@stonecrop/schema'
|
|
2
|
+
import type { FieldMeta, LinkDeclaration } from '@stonecrop/schema'
|
|
3
3
|
import { Router } from 'vue-router'
|
|
4
4
|
|
|
5
5
|
import Doctype from './doctype'
|
|
@@ -161,8 +161,13 @@ export default class Registry {
|
|
|
161
161
|
if ('fieldtype' in field && field.fieldtype === 'Link') {
|
|
162
162
|
const link = linksByFieldname.get(field.fieldname)
|
|
163
163
|
if (!link) {
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
const doctype =
|
|
165
|
+
typeof (field as FieldMeta).options === 'string' ? ((field as FieldMeta).options as string) : undefined
|
|
166
|
+
resolvedFields.push({
|
|
167
|
+
...field,
|
|
168
|
+
component: 'AFormLink',
|
|
169
|
+
...(doctype !== undefined ? { doctype } : {}),
|
|
170
|
+
})
|
|
166
171
|
continue
|
|
167
172
|
}
|
|
168
173
|
|
|
@@ -196,13 +201,12 @@ export default class Registry {
|
|
|
196
201
|
)
|
|
197
202
|
} else {
|
|
198
203
|
// One relationship — embed form schema
|
|
199
|
-
// TODO: remove assertion once resolved link output has a dedicated type separate from input schema
|
|
200
204
|
resolvedFields.push({
|
|
201
205
|
...fieldRest,
|
|
202
206
|
label: fieldRest.label || field.fieldname,
|
|
203
207
|
component: link.component || fieldRest.component || 'AForm',
|
|
204
208
|
schema: childSchema,
|
|
205
|
-
}
|
|
209
|
+
})
|
|
206
210
|
}
|
|
207
211
|
} else if ('schema' in field && Array.isArray(field.schema)) {
|
|
208
212
|
// Fieldset — recursively resolve nested fields
|
|
@@ -258,13 +262,12 @@ export default class Registry {
|
|
|
258
262
|
)
|
|
259
263
|
)
|
|
260
264
|
} else {
|
|
261
|
-
// TODO: remove assertion once resolved link output has a dedicated type separate from input schema
|
|
262
265
|
resolved.push({
|
|
263
266
|
...fieldRest,
|
|
264
267
|
label: fieldRest.label || field.fieldname,
|
|
265
268
|
component: link.component || fieldRest.component || 'AForm',
|
|
266
269
|
schema: childSchema,
|
|
267
|
-
}
|
|
270
|
+
})
|
|
268
271
|
}
|
|
269
272
|
} else if ('schema' in field && Array.isArray(field.schema)) {
|
|
270
273
|
resolved.push({ ...field, schema: this.resolveFields(field.schema, links, visited) })
|
package/src/stonecrop.ts
CHANGED
|
@@ -122,7 +122,6 @@ export class Stonecrop {
|
|
|
122
122
|
|
|
123
123
|
this.registry.addDoctype = (doctype: Doctype) => {
|
|
124
124
|
// Call original method
|
|
125
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
126
125
|
originalAddDoctype(doctype)
|
|
127
126
|
|
|
128
127
|
// Auto-create HST store section for new doctype
|
package/src/stores/hst.ts
CHANGED
|
@@ -153,7 +153,7 @@ class HSTProxy implements HSTNode {
|
|
|
153
153
|
return new Proxy(this, {
|
|
154
154
|
get(hst, prop) {
|
|
155
155
|
// Return HST methods directly
|
|
156
|
-
if (prop in hst) return hst
|
|
156
|
+
if (prop in hst) return Reflect.get(hst, prop)
|
|
157
157
|
|
|
158
158
|
// Handle property access - return tree nodes for navigation
|
|
159
159
|
const path = String(prop)
|
|
@@ -138,13 +138,15 @@ export const useOperationLogStore = defineStore('hst-operation-log', () => {
|
|
|
138
138
|
return operations.value.length - 1 - currentIndex.value
|
|
139
139
|
})
|
|
140
140
|
|
|
141
|
-
const undoRedoState = computed
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
const undoRedoState = computed(
|
|
142
|
+
(): UndoRedoState => ({
|
|
143
|
+
canUndo: canUndo.value,
|
|
144
|
+
canRedo: canRedo.value,
|
|
145
|
+
undoCount: undoCount.value,
|
|
146
|
+
redoCount: redoCount.value,
|
|
147
|
+
currentIndex: currentIndex.value,
|
|
148
|
+
})
|
|
149
|
+
)
|
|
148
150
|
|
|
149
151
|
// Core Methods
|
|
150
152
|
|
|
@@ -517,11 +519,11 @@ export const useOperationLogStore = defineStore('hst-operation-log', () => {
|
|
|
517
519
|
|
|
518
520
|
if (message.type === 'operation' && message.operation) {
|
|
519
521
|
// Add operation from another tab
|
|
520
|
-
operations.value.push({ ...message.operation, source: 'sync'
|
|
522
|
+
operations.value.push({ ...message.operation, source: 'sync' })
|
|
521
523
|
currentIndex.value = operations.value.length - 1
|
|
522
524
|
} else if (message.type === 'operation' && message.operations) {
|
|
523
525
|
// Add batch operations from another tab
|
|
524
|
-
operations.value.push(...message.operations.map(op => ({ ...op, source: 'sync'
|
|
526
|
+
operations.value.push(...message.operations.map((op): HSTOperation => ({ ...op, source: 'sync' })))
|
|
525
527
|
currentIndex.value = operations.value.length - 1
|
|
526
528
|
}
|
|
527
529
|
})
|
package/src/types/doctype.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SchemaTypes } from '@stonecrop/aform'
|
|
2
|
-
import type { LinkDeclaration, WorkflowMeta } from '@stonecrop/schema'
|
|
2
|
+
import type { FieldMeta, LinkDeclaration, WorkflowMeta } from '@stonecrop/schema'
|
|
3
3
|
import { List, Map } from 'immutable'
|
|
4
4
|
import type { AnyStateNodeConfig, UnknownMachineConfig } from 'xstate'
|
|
5
5
|
|
|
@@ -47,7 +47,7 @@ export type DoctypeConfig = {
|
|
|
47
47
|
/** Database table name */
|
|
48
48
|
tableName?: string
|
|
49
49
|
/** Field definitions (including link fields with fieldtype: 'Link') */
|
|
50
|
-
fields?: SchemaTypes[]
|
|
50
|
+
fields?: (SchemaTypes | FieldMeta)[]
|
|
51
51
|
/** Relationship links to other doctypes */
|
|
52
52
|
links?: Record<string, LinkDeclaration>
|
|
53
53
|
/** Workflow configuration (XState format or simple WorkflowMeta) */
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|