@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.
Files changed (43) hide show
  1. package/dist/{composables → src/composables}/lazy-link.js +1 -1
  2. package/dist/src/registry.d.ts.map +1 -1
  3. package/dist/{registry.js → src/registry.js} +6 -4
  4. package/dist/src/stonecrop.d.ts.map +1 -1
  5. package/dist/src/stonecrop.js +565 -0
  6. package/dist/{stores → src/stores}/hst.js +1 -1
  7. package/dist/src/stores/operation-log.d.ts.map +1 -1
  8. package/dist/{stores → src/stores}/operation-log.js +1 -1
  9. package/dist/src/types/doctype.d.ts +2 -2
  10. package/dist/src/types/doctype.d.ts.map +1 -1
  11. package/dist/stonecrop.d.ts +2 -1
  12. package/dist/stonecrop.js +17 -10
  13. package/dist/stonecrop.js.map +1 -1
  14. package/dist/stonecrop.tsbuildinfo +1 -1
  15. package/dist/tsdoc-metadata.json +1 -1
  16. package/package.json +23 -23
  17. package/src/composables/lazy-link.ts +1 -1
  18. package/src/composables/stonecrop.ts +1 -1
  19. package/src/field-triggers.ts +1 -1
  20. package/src/registry.ts +10 -7
  21. package/src/stonecrop.ts +0 -1
  22. package/src/stores/hst.ts +1 -1
  23. package/src/stores/operation-log.ts +11 -9
  24. package/src/types/doctype.ts +2 -2
  25. /package/dist/{composables → src/composables}/operation-log.js +0 -0
  26. /package/dist/{composables → src/composables}/stonecrop.js +0 -0
  27. /package/dist/{doctype.js → src/doctype.js} +0 -0
  28. /package/dist/{exceptions.js → src/exceptions.js} +0 -0
  29. /package/dist/{field-triggers.js → src/field-triggers.js} +0 -0
  30. /package/dist/{index.js → src/index.js} +0 -0
  31. /package/dist/{plugins → src/plugins}/index.js +0 -0
  32. /package/dist/{schema-validator.js → src/schema-validator.js} +0 -0
  33. /package/dist/{stores → src/stores}/index.js +0 -0
  34. /package/dist/{types → src/types}/composable.js +0 -0
  35. /package/dist/{types → src/types}/doctype.js +0 -0
  36. /package/dist/{types → src/types}/field-triggers.js +0 -0
  37. /package/dist/{types → src/types}/hst.js +0 -0
  38. /package/dist/{types → src/types}/index.js +0 -0
  39. /package/dist/{types → src/types}/operation-log.js +0 -0
  40. /package/dist/{types → src/types}/plugin.js +0 -0
  41. /package/dist/{types → src/types}/registry.js +0 -0
  42. /package/dist/{types → src/types}/schema-validator.js +0 -0
  43. /package/dist/{types → src/types}/stonecrop.js +0 -0
@@ -1 +1 @@
1
- {"version":"5.9.3"}
1
+ {"version":"6.0.3"}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.0"
8
+ "packageVersion": "7.58.7"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/stonecrop",
3
- "version": "0.11.7",
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.7"
37
+ "@stonecrop/schema": "0.11.9"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "pinia": "^3.0.4",
41
- "vue": "^3.5.28",
42
- "vue-router": "^5.0.2"
41
+ "vue": "^3.5.33",
42
+ "vue-router": "^5.0.6"
43
43
  },
44
44
  "devDependencies": {
45
- "@eslint/js": "^9.39.2",
46
- "@microsoft/api-documenter": "^7.28.2",
47
- "@rushstack/heft": "^1.2.0",
48
- "@vitejs/plugin-vue": "^6.0.3",
49
- "@vitest/coverage-istanbul": "^4.0.18",
50
- "@vue/test-utils": "^2.4.6",
51
- "eslint": "^9.39.2",
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.6.2",
54
- "globals": "^17.0.0",
55
- "jsdom": "^28.1.0",
56
- "typescript": "^5.9.3",
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.53.0",
59
- "vue": "^3.5.28",
60
- "vue-router": "^5.0.2",
61
- "vite": "^7.3.1",
62
- "vitest": "^4.0.18",
63
- "@stonecrop/atable": "0.11.7",
64
- "@stonecrop/aform": "0.11.7",
65
- "stonecrop-rig": "0.7.0"
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
 
@@ -579,7 +579,7 @@ export function useStonecrop(options?: {
579
579
  return {
580
580
  stonecrop,
581
581
  operationLog,
582
- } as BaseStonecropReturn
582
+ }
583
583
  }
584
584
 
585
585
  /**
@@ -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 as unknown as TransitionActionFunction
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
- // Link field without corresponding link declaration - copy as-is
165
- resolvedFields.push({ ...field })
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
- } as SchemaTypes)
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
- } as SchemaTypes)
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[prop]
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<UndoRedoState>(() => ({
142
- canUndo: canUndo.value,
143
- canRedo: canRedo.value,
144
- undoCount: undoCount.value,
145
- redoCount: redoCount.value,
146
- currentIndex: currentIndex.value,
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' as OperationSource })
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' as OperationSource })))
526
+ operations.value.push(...message.operations.map((op): HSTOperation => ({ ...op, source: 'sync' })))
525
527
  currentIndex.value = operations.value.length - 1
526
528
  }
527
529
  })
@@ -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