@stonecrop/stonecrop 0.4.37 → 0.6.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.
Files changed (78) hide show
  1. package/README.md +92 -3
  2. package/dist/src/composable.d.ts +74 -8
  3. package/dist/src/composable.d.ts.map +1 -1
  4. package/dist/src/composable.js +348 -0
  5. package/dist/src/composables/operation-log.d.ts +136 -0
  6. package/dist/src/composables/operation-log.d.ts.map +1 -0
  7. package/dist/src/composables/operation-log.js +221 -0
  8. package/dist/src/doctype.d.ts +9 -1
  9. package/dist/src/doctype.d.ts.map +1 -1
  10. package/dist/{doctype.js → src/doctype.js} +9 -3
  11. package/dist/src/field-triggers.d.ts +178 -0
  12. package/dist/src/field-triggers.d.ts.map +1 -0
  13. package/dist/src/field-triggers.js +564 -0
  14. package/dist/src/index.d.ts +12 -4
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +18 -0
  17. package/dist/src/plugins/index.d.ts +11 -13
  18. package/dist/src/plugins/index.d.ts.map +1 -1
  19. package/dist/src/plugins/index.js +90 -0
  20. package/dist/src/registry.d.ts +9 -3
  21. package/dist/src/registry.d.ts.map +1 -1
  22. package/dist/{registry.js → src/registry.js} +14 -1
  23. package/dist/src/stonecrop.d.ts +350 -114
  24. package/dist/src/stonecrop.d.ts.map +1 -1
  25. package/dist/src/stonecrop.js +251 -0
  26. package/dist/src/stores/hst.d.ts +157 -0
  27. package/dist/src/stores/hst.d.ts.map +1 -0
  28. package/dist/src/stores/hst.js +483 -0
  29. package/dist/src/stores/index.d.ts +5 -1
  30. package/dist/src/stores/index.d.ts.map +1 -1
  31. package/dist/{stores → src/stores}/index.js +4 -1
  32. package/dist/src/stores/operation-log.d.ts +268 -0
  33. package/dist/src/stores/operation-log.d.ts.map +1 -0
  34. package/dist/src/stores/operation-log.js +571 -0
  35. package/dist/src/types/field-triggers.d.ts +186 -0
  36. package/dist/src/types/field-triggers.d.ts.map +1 -0
  37. package/dist/src/types/field-triggers.js +4 -0
  38. package/dist/src/types/index.d.ts +13 -2
  39. package/dist/src/types/index.d.ts.map +1 -1
  40. package/dist/src/types/index.js +4 -0
  41. package/dist/src/types/operation-log.d.ts +165 -0
  42. package/dist/src/types/operation-log.d.ts.map +1 -0
  43. package/dist/src/types/registry.d.ts +11 -0
  44. package/dist/src/types/registry.d.ts.map +1 -0
  45. package/dist/src/types/registry.js +0 -0
  46. package/dist/stonecrop.d.ts +1555 -159
  47. package/dist/stonecrop.js +1974 -7028
  48. package/dist/stonecrop.js.map +1 -1
  49. package/dist/stonecrop.umd.cjs +4 -8
  50. package/dist/stonecrop.umd.cjs.map +1 -1
  51. package/dist/tests/setup.d.ts +5 -0
  52. package/dist/tests/setup.d.ts.map +1 -0
  53. package/dist/tests/setup.js +15 -0
  54. package/package.json +6 -5
  55. package/src/composable.ts +481 -31
  56. package/src/composables/operation-log.ts +254 -0
  57. package/src/doctype.ts +9 -3
  58. package/src/field-triggers.ts +671 -0
  59. package/src/index.ts +50 -4
  60. package/src/plugins/index.ts +70 -22
  61. package/src/registry.ts +18 -3
  62. package/src/stonecrop.ts +246 -155
  63. package/src/stores/hst.ts +703 -0
  64. package/src/stores/index.ts +6 -1
  65. package/src/stores/operation-log.ts +671 -0
  66. package/src/types/field-triggers.ts +201 -0
  67. package/src/types/index.ts +17 -6
  68. package/src/types/operation-log.ts +205 -0
  69. package/src/types/registry.ts +10 -0
  70. package/dist/composable.js +0 -50
  71. package/dist/index.js +0 -6
  72. package/dist/plugins/index.js +0 -49
  73. package/dist/src/stores/data.d.ts +0 -11
  74. package/dist/src/stores/data.d.ts.map +0 -1
  75. package/dist/stores/data.js +0 -7
  76. package/src/stores/data.ts +0 -8
  77. /package/dist/{exceptions.js → src/exceptions.js} +0 -0
  78. /package/dist/{types/index.js → src/types/operation-log.js} +0 -0
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Field-level action trigger system types
3
+ * @public
4
+ */
5
+
6
+ import { HSTNode } from '../stores/hst'
7
+
8
+ /**
9
+ * Context provided to action functions when field changes occur
10
+ * @public
11
+ */
12
+ export interface FieldChangeContext {
13
+ /** The HST path that was changed */
14
+ path: string
15
+ /** The field name (last segment of path) */
16
+ fieldname: string
17
+ /** Value before the change */
18
+ beforeValue: any
19
+ /** Value after the change */
20
+ afterValue: any
21
+ /** The operation type */
22
+ operation: 'set' | 'delete' | 'patch'
23
+ /** The doctype of the record being changed */
24
+ doctype: string
25
+ /** The record ID if applicable */
26
+ recordId?: string
27
+ /** Timestamp of the change */
28
+ timestamp: Date
29
+ /** Reference to the HST store for state access (optional) */
30
+ store?: HSTNode
31
+ }
32
+
33
+ /**
34
+ * Context provided to XState transition action functions
35
+ * Extends FieldChangeContext with FSM-specific data
36
+ * @public
37
+ */
38
+ export interface TransitionChangeContext extends FieldChangeContext {
39
+ /** The XState transition name that triggered this action */
40
+ transition: string
41
+ /** Current workflow state before transition */
42
+ currentState?: string
43
+ /** Target workflow state after transition */
44
+ targetState?: string
45
+ /** Additional FSM context data */
46
+ fsmContext?: Record<string, any>
47
+ }
48
+
49
+ /**
50
+ * Action function that can be triggered by field changes
51
+ * @public
52
+ */
53
+ export type FieldActionFunction = (context: FieldChangeContext) => void | Promise<void>
54
+
55
+ /**
56
+ * Action function for XState transition triggers
57
+ * Receives enhanced context with FSM state information
58
+ * @public
59
+ */
60
+ export type TransitionActionFunction = (context: TransitionChangeContext) => void | Promise<void>
61
+
62
+ /**
63
+ * String reference to a globally registered action function or inline function
64
+ * @public
65
+ */
66
+ export type FieldActionString = string
67
+
68
+ /**
69
+ * Supported action types for field triggers
70
+ * @public
71
+ */
72
+ export type FieldAction = FieldActionFunction | FieldActionString
73
+
74
+ /**
75
+ * Supported action types for XState transitions
76
+ * Can be either a transition-specific function or a string reference
77
+ * @public
78
+ */
79
+ export type TransitionAction = TransitionActionFunction | FieldActionString
80
+
81
+ /**
82
+ * Configuration for a single field trigger
83
+ * @public
84
+ */
85
+ export interface FieldTriggerConfig {
86
+ /** Array of actions to execute when this field changes */
87
+ actions: FieldAction[]
88
+ /** Optional condition function to determine if actions should run */
89
+ condition?: (context: FieldChangeContext) => boolean | Promise<boolean>
90
+ /** Whether to run actions before or after the value is set (default: 'after') */
91
+ timing?: 'before' | 'after'
92
+ /** Whether to stop execution on first error (default: true) */
93
+ stopOnError?: boolean
94
+ /** Maximum execution time in milliseconds before timeout */
95
+ timeout?: number
96
+ /** Whether to enable automatic rollback for this field trigger (overrides global setting) */
97
+ enableRollback?: boolean
98
+ }
99
+
100
+ /**
101
+ * Map of field paths to trigger configurations
102
+ * Supports wildcard patterns like 'emailAddress.*.is_primary'
103
+ * @public
104
+ */
105
+ export type FieldTriggerMap = Record<string, FieldTriggerConfig | FieldAction[]>
106
+
107
+ /**
108
+ * Registry for storing global action functions
109
+ * @public
110
+ */
111
+ export interface ActionRegistry {
112
+ /** Register a global action function */
113
+ register(name: string, fn: FieldActionFunction): void
114
+ /** Get a registered action function */
115
+ get(name: string): FieldActionFunction | undefined
116
+ /** Check if an action is registered */
117
+ has(name: string): boolean
118
+ /** Unregister an action function */
119
+ unregister(name: string): void
120
+ /** Get all registered action names */
121
+ list(): string[]
122
+ }
123
+
124
+ /**
125
+ * Result of executing a field action
126
+ * @public
127
+ */
128
+ export interface ActionExecutionResult {
129
+ /** Whether the action executed successfully */
130
+ success: boolean
131
+ /** Error if execution failed */
132
+ error?: Error
133
+ /** Execution time in milliseconds */
134
+ executionTime: number
135
+ /** The action that was executed */
136
+ action: FieldAction
137
+ }
138
+
139
+ /**
140
+ * Result of executing an XState transition action
141
+ * @public
142
+ */
143
+ export interface TransitionExecutionResult {
144
+ /** Whether the action executed successfully */
145
+ success: boolean
146
+ /** Error if execution failed */
147
+ error?: Error
148
+ /** Execution time in milliseconds */
149
+ executionTime: number
150
+ /** The action that was executed */
151
+ action: TransitionAction
152
+ /** The transition name that was executed */
153
+ transition: string
154
+ }
155
+
156
+ /**
157
+ * Result of executing all actions for a field change
158
+ * @public
159
+ */
160
+ export interface FieldTriggerExecutionResult {
161
+ /** The path that triggered the actions */
162
+ path: string
163
+ /** Results for each action that was executed */
164
+ actionResults: ActionExecutionResult[]
165
+ /** Total execution time for all actions */
166
+ totalExecutionTime: number
167
+ /** Whether all actions succeeded */
168
+ allSucceeded: boolean
169
+ /** Whether execution was stopped due to an error */
170
+ stoppedOnError: boolean
171
+ /** Whether a rollback was performed */
172
+ rolledBack: boolean
173
+ /** The snapshot that was captured before execution */
174
+ snapshot?: any
175
+ }
176
+
177
+ /**
178
+ * Options for the field trigger system
179
+ * @public
180
+ */
181
+ export interface FieldTriggerOptions {
182
+ /** Default timeout for action execution in milliseconds */
183
+ defaultTimeout?: number
184
+ /** Whether to log trigger executions for debugging */
185
+ debug?: boolean
186
+ /** Custom error handler for action failures */
187
+ errorHandler?: (error: Error, context: FieldChangeContext, action: FieldAction) => void
188
+ /** Whether to enable automatic rollback on failure (default: true) */
189
+ enableRollback?: boolean
190
+ }
191
+
192
+ /**
193
+ * Pattern matching result for wildcard paths
194
+ * @internal
195
+ */
196
+ export interface _PathMatchResult {
197
+ /** Whether the path matches the pattern */
198
+ matches: boolean
199
+ /** Captured wildcard values */
200
+ captures: Record<string, string>
201
+ }
@@ -4,15 +4,17 @@ import type { Component } from 'vue'
4
4
  import type { Router } from 'vue-router'
5
5
  import type { AnyStateNodeConfig, UnknownMachineConfig } from 'xstate'
6
6
 
7
- import DoctypeMeta from '../doctype'
7
+ import type DoctypeMeta from '../doctype'
8
+ import Registry from '../registry'
9
+ import { Stonecrop } from '../stonecrop'
10
+ import type { RouteContext } from './registry'
8
11
 
9
12
  /**
10
13
  * Immutable Doctype type for Stonecrop instances
11
14
  * @public
12
15
  */
13
16
  export type ImmutableDoctype = {
14
- // TODO: allow schema to be a function
15
- readonly schema?: List<SchemaTypes>
17
+ readonly schema?: List<SchemaTypes> // TODO: allow schema to be a function
16
18
  readonly workflow?: UnknownMachineConfig | AnyStateNodeConfig
17
19
  readonly actions?: Map<string, string[]>
18
20
  }
@@ -22,8 +24,8 @@ export type ImmutableDoctype = {
22
24
  * @public
23
25
  */
24
26
  export type MutableDoctype = {
25
- // TODO: allow schema to be a function
26
- schema?: SchemaTypes[]
27
+ doctype?: string
28
+ schema?: SchemaTypes[] // TODO: allow schema to be a function
27
29
  workflow?: UnknownMachineConfig | AnyStateNodeConfig
28
30
  actions?: Record<string, string[]>
29
31
  }
@@ -44,5 +46,14 @@ export type Schema = {
44
46
  export type InstallOptions = {
45
47
  router?: Router
46
48
  components?: Record<string, Component>
47
- getMeta?: (doctype?: string) => DoctypeMeta | Promise<DoctypeMeta>
49
+ getMeta?: (routeContext: RouteContext) => DoctypeMeta | Promise<DoctypeMeta>
50
+ /** Automatically run initialization callback after app mounting (default: false) */
51
+ autoInitializeRouter?: boolean
52
+ /** Callback function called after plugin is ready and mounted */
53
+ onRouterInitialized?: (registry: Registry, stonecrop: Stonecrop) => void | Promise<void>
48
54
  }
55
+
56
+ // Re-export types
57
+ export * from './field-triggers'
58
+ export * from './registry'
59
+ export * from './operation-log'
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Type of HST operation
3
+ * @public
4
+ */
5
+ export type HSTOperationType = 'set' | 'delete' | 'batch' | 'transition' | 'action'
6
+
7
+ /**
8
+ * Operation source - where the change originated
9
+ * @public
10
+ */
11
+ export type OperationSource = 'user' | 'system' | 'sync' | 'undo' | 'redo'
12
+
13
+ /**
14
+ * Complete metadata for an HST mutation
15
+ * Enables time travel, synchronization, and audit trails
16
+ * @public
17
+ */
18
+ export interface HSTOperation {
19
+ /** Unique operation identifier */
20
+ id: string
21
+
22
+ /** Type of operation performed */
23
+ type: HSTOperationType
24
+
25
+ /** Full HST path affected (e.g., "task.123.title") */
26
+ path: string
27
+
28
+ /** Field name extracted from path */
29
+ fieldname: string
30
+
31
+ /** Value before the operation */
32
+ beforeValue: any
33
+
34
+ /** Value after the operation */
35
+ afterValue: any
36
+
37
+ /** Doctype this operation affects */
38
+ doctype: string
39
+
40
+ /** Record ID if applicable */
41
+ recordId?: string
42
+
43
+ /** Timestamp of the operation */
44
+ timestamp: Date
45
+
46
+ /** Source of the operation (defaults to 'user' if not specified) */
47
+ source?: OperationSource
48
+
49
+ /** Whether this operation can be undone */
50
+ reversible: boolean
51
+
52
+ /** Reason if operation is irreversible */
53
+ irreversibleReason?: string
54
+
55
+ /** XState transition name if triggered by FSM */
56
+ transition?: string
57
+
58
+ /** XState current state before transition */
59
+ currentState?: string
60
+
61
+ /** XState target state after transition */
62
+ targetState?: string
63
+
64
+ /** Action name if operation is an action execution (type: 'action') */
65
+ actionName?: string
66
+
67
+ /** Record IDs that the action was executed on */
68
+ actionRecordIds?: string[]
69
+
70
+ /** Result or status of the action execution */
71
+ actionResult?: 'success' | 'failure' | 'pending'
72
+
73
+ /** Error message if action execution failed */
74
+ actionError?: string
75
+
76
+ /** User or session identifier */
77
+ userId?: string
78
+
79
+ /** Additional metadata for custom use cases */
80
+ metadata?: Record<string, any>
81
+
82
+ /** Parent operation ID for batch operations */
83
+ parentOperationId?: string
84
+
85
+ /** Child operation IDs for batch operations */
86
+ childOperationIds?: string[]
87
+ }
88
+
89
+ /**
90
+ * Input type for adding operations
91
+ * Excludes system-generated fields (id, timestamp)
92
+ * @public
93
+ */
94
+ export type HSTOperationInput = Omit<HSTOperation, 'id' | 'timestamp' | 'source'> & {
95
+ source?: OperationSource
96
+ }
97
+
98
+ /**
99
+ * Batch operation wrapper
100
+ * @public
101
+ */
102
+ export interface BatchOperation {
103
+ /** Unique batch identifier */
104
+ id: string
105
+ /** Operations included in this batch */
106
+ operations: HSTOperation[]
107
+ /** When the batch was created */
108
+ timestamp: Date
109
+ /** Optional description of what this batch represents */
110
+ description?: string
111
+ /** Whether the entire batch can be undone */
112
+ reversible: boolean
113
+ }
114
+
115
+ /**
116
+ * Operation log configuration
117
+ * @public
118
+ */
119
+ export interface OperationLogConfig {
120
+ /** Maximum operations to store (default: 100) */
121
+ maxOperations?: number
122
+
123
+ /** Enable cross-tab synchronization (default: true) */
124
+ enableCrossTabSync?: boolean
125
+
126
+ /** Auto-sync interval in milliseconds (default: 30000) */
127
+ autoSyncInterval?: number
128
+
129
+ /** Enable operation persistence to localStorage (default: false) */
130
+ enablePersistence?: boolean
131
+
132
+ /** Persistence key prefix */
133
+ persistenceKeyPrefix?: string
134
+
135
+ /** User identifier for multi-user scenarios */
136
+ userId?: string
137
+
138
+ /** Custom operation filter */
139
+ operationFilter?: (operation: HSTOperation) => boolean
140
+ }
141
+
142
+ /**
143
+ * Undo/Redo state
144
+ * @public
145
+ */
146
+ export interface UndoRedoState {
147
+ /** Can undo */
148
+ canUndo: boolean
149
+
150
+ /** Can redo */
151
+ canRedo: boolean
152
+
153
+ /** Number of operations available for undo */
154
+ undoCount: number
155
+
156
+ /** Number of operations available for redo */
157
+ redoCount: number
158
+
159
+ /** Current operation index */
160
+ currentIndex: number
161
+ }
162
+
163
+ /**
164
+ * Operation log snapshot for debugging
165
+ * @public
166
+ */
167
+ export interface OperationLogSnapshot {
168
+ /** All operations in the log */
169
+ operations: HSTOperation[]
170
+ /** Current operation index in the history */
171
+ currentIndex: number
172
+ /** Total number of operations */
173
+ totalOperations: number
174
+ /** Number of operations that can be undone */
175
+ reversibleOperations: number
176
+ /** Number of operations that cannot be undone */
177
+ irreversibleOperations: number
178
+ /** Timestamp of the oldest operation */
179
+ oldestOperation?: Date
180
+ /** Timestamp of the newest operation */
181
+ newestOperation?: Date
182
+ }
183
+
184
+ /**
185
+ * Cross-tab message types
186
+ * @public
187
+ */
188
+ export type CrossTabMessageType = 'operation' | 'undo' | 'redo' | 'sync-request' | 'sync-response'
189
+
190
+ /**
191
+ * Cross-tab message payload
192
+ * @public
193
+ */
194
+ export interface CrossTabMessage {
195
+ /** Type of cross-tab message */
196
+ type: CrossTabMessageType
197
+ /** Single operation for operation/undo/redo messages */
198
+ operation?: HSTOperation
199
+ /** Multiple operations for sync messages */
200
+ operations?: HSTOperation[]
201
+ /** Identifier of the client/tab sending the message */
202
+ clientId: string
203
+ /** When the message was sent */
204
+ timestamp: Date
205
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Route context passed to getMeta function
3
+ * @public
4
+ */
5
+ export interface RouteContext {
6
+ /** The full route path (e.g., "/todo/1" or "/todo") */
7
+ path: string
8
+ /** Path segments split by "/" (e.g., ["todo", "1"] or ["todo"]) */
9
+ segments: string[]
10
+ }
@@ -1,50 +0,0 @@
1
- import { inject, onMounted, ref } from 'vue';
2
- import { Stonecrop } from './stonecrop';
3
- import { useDataStore } from './stores/data';
4
- /**
5
- * Stonecrop composable
6
- * @param registry - An existing Stonecrop Registry instance
7
- * @returns The Stonecrop instance and a boolean indicating if Stonecrop is setup and ready
8
- * @throws Error if the Stonecrop plugin is not enabled before using the composable
9
- * @public
10
- */
11
- export function useStonecrop(registry) {
12
- const stonecrop = ref();
13
- onMounted(async () => {
14
- if (!registry) {
15
- registry = inject('$registry');
16
- }
17
- if (!registry || !registry.router)
18
- return;
19
- let store;
20
- try {
21
- store = useDataStore();
22
- }
23
- catch {
24
- throw new Error('Please enable the Stonecrop plugin before using the Stonecrop composable');
25
- }
26
- stonecrop.value = new Stonecrop(registry, store);
27
- const route = registry.router.currentRoute.value;
28
- const doctypeSlug = route.params.records?.toString().toLowerCase();
29
- const recordId = route.params.record?.toString().toLowerCase(); // TODO: handle views other than list and form views?
30
- if (!doctypeSlug && !recordId) {
31
- return;
32
- }
33
- // setup doctype via registry
34
- const doctype = await registry.getMeta?.(doctypeSlug);
35
- if (doctype) {
36
- registry.addDoctype(doctype);
37
- stonecrop.value.setup(doctype);
38
- if (doctypeSlug) {
39
- if (recordId) {
40
- await stonecrop.value.getRecord(doctype, recordId);
41
- }
42
- else {
43
- await stonecrop.value.getRecords(doctype);
44
- }
45
- }
46
- stonecrop.value.runAction(doctype, 'load', recordId ? [recordId] : undefined);
47
- }
48
- });
49
- return { stonecrop };
50
- }
package/dist/index.js DELETED
@@ -1,6 +0,0 @@
1
- import { useStonecrop } from './composable';
2
- import DoctypeMeta from './doctype';
3
- import Registry from './registry';
4
- import Stonecrop from './plugins';
5
- import { Stonecrop as StonecropClass } from './stonecrop';
6
- export { DoctypeMeta, Registry, Stonecrop, StonecropClass, useStonecrop };
@@ -1,49 +0,0 @@
1
- import Registry from '../registry';
2
- import { pinia } from '../stores';
3
- /**
4
- * Stonecrop Vue plugin
5
- * @param app - The Vue app instance
6
- * @param options - The plugin options
7
- * @example
8
- * ```ts
9
- *
10
- * import { createApp } from 'vue'
11
- * import Stonecrop from 'stonecrop'
12
- *
13
- * import App from './App.vue'
14
- *
15
- * const app = createApp(App)
16
- * app.use(Stonecrop, {
17
- * router,
18
- * components: {
19
- * // register custom components
20
- * },
21
- * getMeta: async (doctype: string) => {
22
- * // fetch doctype meta from API
23
- * },
24
- * })
25
- *
26
- * app.mount('#app')
27
- * ```
28
- *
29
- * @public
30
- */
31
- const plugin = {
32
- install: (app, options) => {
33
- // check if the router is already installed via another plugin
34
- const existingRouter = app.config.globalProperties.$router;
35
- const appRouter = existingRouter || options?.router;
36
- const registry = new Registry(appRouter, options?.getMeta);
37
- if (!existingRouter && appRouter) {
38
- app.use(appRouter);
39
- }
40
- app.use(pinia);
41
- app.provide('$registry', registry);
42
- if (options?.components) {
43
- for (const [tag, component] of Object.entries(options.components)) {
44
- app.component(tag, component);
45
- }
46
- }
47
- },
48
- };
49
- export default plugin;
@@ -1,11 +0,0 @@
1
- export declare const useDataStore: import("pinia").StoreDefinition<"data", Pick<{
2
- records: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
3
- record: import("vue").Ref<Record<string, any>, Record<string, any>>;
4
- }, "records" | "record">, Pick<{
5
- records: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
6
- record: import("vue").Ref<Record<string, any>, Record<string, any>>;
7
- }, never>, Pick<{
8
- records: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
9
- record: import("vue").Ref<Record<string, any>, Record<string, any>>;
10
- }, never>>;
11
- //# sourceMappingURL=data.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/stores/data.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY;;;;;;;;;UAIvB,CAAA"}
@@ -1,7 +0,0 @@
1
- import { defineStore } from 'pinia';
2
- import { ref } from 'vue';
3
- export const useDataStore = defineStore('data', () => {
4
- const records = ref([]);
5
- const record = ref({});
6
- return { records, record };
7
- });
@@ -1,8 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- export const useDataStore = defineStore('data', () => {
5
- const records = ref<Record<string, any>[]>([])
6
- const record = ref<Record<string, any>>({})
7
- return { records, record }
8
- })
File without changes