@@ -60,22 +60,9 @@
diff --git a/examples/docbuilder/index.ts b/examples/docbuilder/index.ts
index 9bfdbe3d..1cb46a06 100644
--- a/examples/docbuilder/index.ts
+++ b/examples/docbuilder/index.ts
@@ -1,30 +1,23 @@
+import { createPinia } from 'pinia'
import { createApp } from 'vue'
-import '@stonecrop/aform/styles'
-import '@stonecrop/atable/styles'
import '@stonecrop/desktop/styles'
import '@stonecrop/node-editor/styles'
-import { AFieldset, AForm, ANumericInput, ATextInput } from '@stonecrop/aform'
-import { ACell, ARow, ATableHeader, ATableModal, ATable } from '@stonecrop/atable'
+import { install as ATablePlugin } from '@stonecrop/aform'
+import { install as AFormPlugin } from '@stonecrop/atable'
import { ActionSet, SheetNav } from '@stonecrop/desktop'
-import { NodeEditor, StateEditor } from '@stonecrop/node-editor'
+import { install as NodeEditorPlugin } from '@stonecrop/node-editor'
import App from './App.vue'
import router from './router'
-let app = createApp(App)
+const app = createApp(App)
+const pinia = createPinia()
+app.use(pinia)
app.use(router)
-app.component('ACell', ACell)
-app.component('AFieldset', AFieldset)
-app.component('AForm', AForm)
-app.component('ANumericInput', ANumericInput)
-app.component('ARow', ARow)
-app.component('ATable', ATable)
-app.component('ATableHeader', ATableHeader)
-app.component('ATableModal', ATableModal)
-app.component('ATextInput', ATextInput)
-app.component('NodeEditor', NodeEditor)
-app.component('StateEditor', StateEditor)
+app.use(AFormPlugin)
+app.use(ATablePlugin)
+app.use(NodeEditorPlugin)
app.component('ActionSet', ActionSet)
app.component('SheetNav', SheetNav)
app.mount('#app')
diff --git a/examples/docbuilder/server.ts b/examples/docbuilder/server.ts
index c364d477..98fafe66 100644
--- a/examples/docbuilder/server.ts
+++ b/examples/docbuilder/server.ts
@@ -20,7 +20,7 @@ export function makeServer({ environment = 'development' } = {}) {
doctypes: [{ name: 'Issue' }, { name: 'Assignment' }, { name: 'User' }],
stateMachines: [
{
- name: 'Issue',
+ name: 'issue',
machine: {
id: 'Issue',
initial: 'New',
@@ -88,7 +88,7 @@ export function makeServer({ environment = 'development' } = {}) {
},
},
{
- name: 'Assignment',
+ name: 'assignment',
machine: {
id: 'Assignment',
initial: 'New',
@@ -133,7 +133,7 @@ export function makeServer({ environment = 'development' } = {}) {
},
},
{
- name: 'User',
+ name: 'user',
machine: {
id: 'User',
invoke: {
@@ -174,7 +174,7 @@ export function makeServer({ environment = 'development' } = {}) {
],
meta: [
{
- name: 'Issue',
+ name: 'issue',
fields: [
{
id: 'subject',
@@ -225,7 +225,7 @@ export function makeServer({ environment = 'development' } = {}) {
],
},
{
- name: 'Assignment',
+ name: 'assignment',
fields: [
{
id: 'user',
@@ -264,7 +264,7 @@ export function makeServer({ environment = 'development' } = {}) {
],
},
{
- name: 'User',
+ name: 'user',
fields: [
{
id: 'username',
@@ -294,7 +294,7 @@ export function makeServer({ environment = 'development' } = {}) {
],
actions: [
{
- name: 'Issue',
+ name: 'issue',
side_effects: [
{
event_name: 'LOAD',
@@ -321,7 +321,7 @@ export function makeServer({ environment = 'development' } = {}) {
],
},
{
- name: 'Assignment',
+ name: 'assignment',
side_effects: [
{
event_name: 'LOAD',
@@ -348,7 +348,7 @@ export function makeServer({ environment = 'development' } = {}) {
],
},
{
- name: 'User',
+ name: 'user',
side_effects: [
{
event_name: 'LOAD',
@@ -398,21 +398,24 @@ export function makeServer({ environment = 'development' } = {}) {
})
this.get('/load_state_machine', (schema, request) => {
- let machine = schema.stateMachines.findBy({ name: request.queryParams.doctype })
+ const doctype = request.queryParams.doctype.toString().toLowerCase()
+ const machine = schema.stateMachines.findBy({ name: doctype })
return machine
? machine.attrs
: new Response(400, { some: 'Not Found' }, { errors: ['StateMachine for Doctype not found'] })
})
this.get('/load_meta', (schema, request) => {
- let meta = schema.meta.findBy({ name: request.queryParams.doctype })
+ const doctype = request.queryParams.doctype.toString().toLowerCase()
+ const meta = schema.meta.findBy({ name: doctype })
return meta
? meta.attrs.fields
: new Response(400, { some: 'Not Found' }, { errors: ['Metadata for Doctype not found'] })
})
this.get('/load_side_effects', (schema, request) => {
- let actions = schema.actions.findBy({ name: request.queryParams.doctype })
+ const doctype = request.queryParams.doctype.toString().toLowerCase()
+ const actions = schema.actions.findBy({ name: doctype })
return actions
? actions.attrs.side_effects
: new Response(400, { some: 'Not Found' }, { errors: ['Actions for Doctype not found'] })
diff --git a/examples/docbuilder/vite.config.ts b/examples/docbuilder/vite.config.ts
index 6a43aa7d..56d342f3 100644
--- a/examples/docbuilder/vite.config.ts
+++ b/examples/docbuilder/vite.config.ts
@@ -17,7 +17,7 @@ export default defineConfig({
build: {
sourcemap: true,
lib: {
- entry: resolve(projectRootDir, 'docbuilder/index.ts'),
+ entry: resolve(projectRootDir, 'index.ts'),
name: '@stonecrop/examples',
},
rollupOptions: {