diff --git a/packages/forms/src/builder/builder.test.ts b/packages/forms/src/builder/builder.test.ts index 023d6e28..97cc3bfd 100644 --- a/packages/forms/src/builder/builder.test.ts +++ b/packages/forms/src/builder/builder.test.ts @@ -5,8 +5,8 @@ import { defaultFormConfig } from '../patterns/index.js'; import { type FieldsetPattern } from '../patterns/fieldset/config.js'; import { type FormSummaryPattern } from '../patterns/form-summary.js'; import { type InputPattern } from '../patterns/input/config.js'; -import { type PagePattern } from '../patterns/page/config.js'; -import { type PageSetPattern } from '../patterns/page-set/config.js'; +import { type PagePattern } from '../patterns/pages/page/config.js'; +import { type PageSetPattern } from '../patterns/pages/page-set/config.js'; import { type RadioGroupPattern } from '../patterns/radio-group.js'; import { BlueprintBuilder } from './index.js'; diff --git a/packages/forms/src/builder/index.ts b/packages/forms/src/builder/index.ts index 5f109702..57696720 100644 --- a/packages/forms/src/builder/index.ts +++ b/packages/forms/src/builder/index.ts @@ -21,7 +21,7 @@ import { type PatternMap, } from '../pattern.js'; import { type FieldsetPattern } from '../patterns/fieldset/config.js'; -import { type PageSetPattern } from '../patterns/page-set/config.js'; +import { type PageSetPattern } from '../patterns/pages/page-set/config.js'; import type { Blueprint, FormSummary } from '../types.js'; export class BlueprintBuilder { diff --git a/packages/forms/src/documents/__tests__/document.test.ts b/packages/forms/src/documents/__tests__/document.test.ts index 50ff3d44..5b7e4205 100644 --- a/packages/forms/src/documents/__tests__/document.test.ts +++ b/packages/forms/src/documents/__tests__/document.test.ts @@ -6,8 +6,8 @@ import { describe, expect, it } from 'vitest'; import { getPattern } from '../../index.js'; import { BlueprintBuilder } from '../../builder/index.js'; import { defaultFormConfig } from '../../patterns/index.js'; -import { type PageSetPattern } from '../../patterns/page-set/config.js'; -import { type PagePattern } from '../../patterns/page/config.js'; +import { type PageSetPattern } from '../../patterns/pages/page-set/config.js'; +import { type PagePattern } from '../../patterns/pages/page/config.js'; import { addDocument } from '../document.js'; import { loadSamplePDF } from './sample-data.js'; diff --git a/packages/forms/src/documents/pdf/parsing-api.ts b/packages/forms/src/documents/pdf/parsing-api.ts index 174d2cf6..ddf80569 100644 --- a/packages/forms/src/documents/pdf/parsing-api.ts +++ b/packages/forms/src/documents/pdf/parsing-api.ts @@ -2,8 +2,8 @@ import * as z from 'zod'; import { type FieldsetPattern } from '../../patterns/fieldset/config.js'; import { type InputPattern } from '../../patterns/input/config.js'; -import { PagePattern } from '../../patterns/page/config.js'; -import { PageSetPattern } from '../../patterns/page-set/config.js'; +import { PagePattern } from '../../patterns/pages/page/config.js'; +import { PageSetPattern } from '../../patterns/pages/page-set/config.js'; import { type ParagraphPattern } from '../../patterns/paragraph.js'; import { type CheckboxPattern } from '../../patterns/checkbox.js'; import { type RadioGroupPattern } from '../../patterns/radio-group.js'; diff --git a/packages/forms/src/patterns/index.ts b/packages/forms/src/patterns/index.ts index 4fe5dbcd..06719745 100644 --- a/packages/forms/src/patterns/index.ts +++ b/packages/forms/src/patterns/index.ts @@ -7,8 +7,8 @@ import { fieldsetConfig } from './fieldset/index.js'; import { formSummaryConfig } from './form-summary.js'; import { inputConfig } from './input/index.js'; import { packageDownloadConfig } from './package-download/index.js'; -import { pageConfig } from './page/index.js'; -import { pageSetConfig } from './page-set/index.js'; +import { pageConfig } from './pages/page/index.js'; +import { pageSetConfig } from './pages/page-set/index.js'; import { paragraphConfig } from './paragraph.js'; import { radioGroupConfig } from './radio-group.js'; import { richTextConfig } from './rich-text.js'; @@ -46,10 +46,10 @@ export * from './form-summary.js'; export * from './input/index.js'; export { type InputPattern } from './input/config.js'; export * from './package-download/index.js'; -export * from './page/index.js'; -export { type PagePattern } from './page/config.js'; -export * from './page-set/index.js'; -export { type PageSetPattern } from './page-set/config.js'; +export * from './pages/page/index.js'; +export { type PagePattern } from './pages/page/config.js'; +export * from './pages/page-set/index.js'; +export { type PageSetPattern } from './pages/page-set/config.js'; export * from './paragraph.js'; export * from './radio-group.js'; export * from './select-dropdown/select-dropdown.js'; diff --git a/packages/forms/src/patterns/package-download/submit.test.ts b/packages/forms/src/patterns/package-download/submit.test.ts index df5464de..6ceec324 100644 --- a/packages/forms/src/patterns/package-download/submit.test.ts +++ b/packages/forms/src/patterns/package-download/submit.test.ts @@ -6,8 +6,8 @@ import { type Blueprint, type FormSession, defaultFormConfig } from '../..'; import { downloadPackageHandler } from './submit'; import { PackageDownload } from './builder'; -import { PageSet } from '../page-set/builder'; -import { Page } from '../page/builder'; +import { PageSet } from '../pages/page-set/builder'; +import { Page } from '../pages/page/builder'; import { Input } from '../input/builder'; import { loadSamplePDF } from '../../documents/__tests__/sample-data'; diff --git a/packages/forms/src/patterns/page-set/builder.ts b/packages/forms/src/patterns/pages/page-set/builder.ts similarity index 80% rename from packages/forms/src/patterns/page-set/builder.ts rename to packages/forms/src/patterns/pages/page-set/builder.ts index db1d8842..83b6125d 100644 --- a/packages/forms/src/patterns/page-set/builder.ts +++ b/packages/forms/src/patterns/pages/page-set/builder.ts @@ -1,5 +1,5 @@ -import { type Blueprint } from '../..'; -import { PatternBuilder } from '../../pattern'; +import { type Blueprint } from '../../..'; +import { PatternBuilder } from '../../../pattern'; import { type Page } from '../page/builder'; import { type PageSetPattern } from './config'; diff --git a/packages/forms/src/patterns/page-set/config.ts b/packages/forms/src/patterns/pages/page-set/config.ts similarity index 83% rename from packages/forms/src/patterns/page-set/config.ts rename to packages/forms/src/patterns/pages/page-set/config.ts index 0e8a7423..6144ac6e 100644 --- a/packages/forms/src/patterns/page-set/config.ts +++ b/packages/forms/src/patterns/pages/page-set/config.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; -import { type Pattern, type ParsePatternConfigData } from '../../pattern.js'; -import { safeZodParseFormErrors } from '../../util/zod.js'; +import { type Pattern, type ParsePatternConfigData } from '../../../pattern.js'; +import { safeZodParseFormErrors } from '../../../util/zod.js'; const configSchema = z.object({ pages: z.array(z.string()), diff --git a/packages/forms/src/patterns/page-set/index.ts b/packages/forms/src/patterns/pages/page-set/index.ts similarity index 92% rename from packages/forms/src/patterns/page-set/index.ts rename to packages/forms/src/patterns/pages/page-set/index.ts index e0ad4797..078f2dce 100644 --- a/packages/forms/src/patterns/page-set/index.ts +++ b/packages/forms/src/patterns/pages/page-set/index.ts @@ -1,4 +1,4 @@ -import { type PatternConfig, type PatternId } from '../../pattern.js'; +import { type PatternConfig, type PatternId } from '../../../pattern.js'; import { type PageSetPattern, parseConfigData } from './config.js'; import { createPrompt } from './prompt.js'; diff --git a/packages/forms/src/patterns/page-set/prompt.test.ts b/packages/forms/src/patterns/pages/page-set/prompt.test.ts similarity index 91% rename from packages/forms/src/patterns/page-set/prompt.test.ts rename to packages/forms/src/patterns/pages/page-set/prompt.test.ts index 279135e8..ca88ad47 100644 --- a/packages/forms/src/patterns/page-set/prompt.test.ts +++ b/packages/forms/src/patterns/pages/page-set/prompt.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest'; -import { defaultFormConfig } from '..'; -import { createFormSession } from '../../session'; +import { defaultFormConfig } from '../..'; +import { createFormSession } from '../../../session'; -import { Input } from '../input/builder'; +import { Input } from '../../input/builder'; import { Page } from '../page/builder'; -import type { Blueprint } from '../../types'; +import type { Blueprint } from '../../../types'; import { PageSet } from './builder'; import { createPrompt } from './prompt'; diff --git a/packages/forms/src/patterns/page-set/prompt.ts b/packages/forms/src/patterns/pages/page-set/prompt.ts similarity index 89% rename from packages/forms/src/patterns/page-set/prompt.ts rename to packages/forms/src/patterns/pages/page-set/prompt.ts index a641776d..fffd61a5 100644 --- a/packages/forms/src/patterns/page-set/prompt.ts +++ b/packages/forms/src/patterns/pages/page-set/prompt.ts @@ -1,18 +1,18 @@ import { z } from 'zod'; -import { type RouteData } from '../../route-data.js'; -import { safeZodParseFormErrors } from '../../util/zod.js'; +import { type RouteData } from '../../../route-data.js'; +import { safeZodParseFormErrors } from '../../../util/zod.js'; import { type PagePattern } from '../page/config.js'; -import { type ActionName, getActionString } from '../../submission.js'; +import { type ActionName, getActionString } from '../../../submission.js'; import { type CreatePrompt, type PageSetProps, type PromptAction, createPromptForPattern, -} from '../../components.js'; -import { getPattern } from '../../pattern.js'; -import { type FormSession } from '../../session.js'; +} from '../../../components.js'; +import { getPattern } from '../../../pattern.js'; +import { type FormSession } from '../../../session.js'; import { type PageSetPattern } from './config.js'; diff --git a/packages/forms/src/patterns/page/builder.ts b/packages/forms/src/patterns/pages/page/builder.ts similarity index 80% rename from packages/forms/src/patterns/page/builder.ts rename to packages/forms/src/patterns/pages/page/builder.ts index afe124ad..1ec6eb54 100644 --- a/packages/forms/src/patterns/page/builder.ts +++ b/packages/forms/src/patterns/pages/page/builder.ts @@ -1,4 +1,4 @@ -import { PatternBuilder } from '../../pattern'; +import { PatternBuilder } from '../../../pattern'; import { type PagePattern } from './config'; export class Page extends PatternBuilder { diff --git a/packages/forms/src/patterns/page/config.ts b/packages/forms/src/patterns/pages/page/config.ts similarity index 93% rename from packages/forms/src/patterns/page/config.ts rename to packages/forms/src/patterns/pages/page/config.ts index 2d5aee0f..4b26d248 100644 --- a/packages/forms/src/patterns/page/config.ts +++ b/packages/forms/src/patterns/pages/page/config.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; -import { type Pattern, type ParsePatternConfigData } from '../../pattern.js'; -import { safeZodParseFormErrors } from '../../util/zod.js'; +import { type Pattern, type ParsePatternConfigData } from '../../../pattern.js'; +import { safeZodParseFormErrors } from '../../../util/zod.js'; const configSchema = z.object({ title: z.string(), diff --git a/packages/forms/src/patterns/page/index.ts b/packages/forms/src/patterns/pages/page/index.ts similarity index 93% rename from packages/forms/src/patterns/page/index.ts rename to packages/forms/src/patterns/pages/page/index.ts index 5cf032af..cd7963ae 100644 --- a/packages/forms/src/patterns/page/index.ts +++ b/packages/forms/src/patterns/pages/page/index.ts @@ -1,4 +1,4 @@ -import { type PatternConfig } from '../../pattern.js'; +import { type PatternConfig } from '../../../pattern.js'; import { type PagePattern, parseConfigData } from './config.js'; import { createPrompt } from './prompt.js'; diff --git a/packages/forms/src/patterns/page/prompt.ts b/packages/forms/src/patterns/pages/page/prompt.ts similarity index 87% rename from packages/forms/src/patterns/page/prompt.ts rename to packages/forms/src/patterns/pages/page/prompt.ts index 0427ec8b..181f7b02 100644 --- a/packages/forms/src/patterns/page/prompt.ts +++ b/packages/forms/src/patterns/pages/page/prompt.ts @@ -2,8 +2,8 @@ import { type CreatePrompt, type PageProps, createPromptForPattern, -} from '../../components.js'; -import { getPattern } from '../../pattern.js'; +} from '../../../components.js'; +import { getPattern } from '../../../pattern.js'; import { type PagePattern } from './config.js'; diff --git a/packages/forms/src/patterns/page-set/submit.test.ts b/packages/forms/src/patterns/pages/submit.test.ts similarity index 95% rename from packages/forms/src/patterns/page-set/submit.test.ts rename to packages/forms/src/patterns/pages/submit.test.ts index b6e02fec..9308f77c 100644 --- a/packages/forms/src/patterns/page-set/submit.test.ts +++ b/packages/forms/src/patterns/pages/submit.test.ts @@ -1,9 +1,9 @@ import { describe, expect, it } from 'vitest'; -import { type Blueprint, defaultFormConfig } from '../..'; -import { Input } from '../input/builder'; +import { type Blueprint, defaultFormConfig } from '../../..'; +import { Input } from '../../input/builder'; import { Page } from '../page/builder'; -import { createFormSession } from '../../session'; +import { createFormSession } from '../../../session'; import { PageSet } from './builder'; import { submitPage } from './submit'; diff --git a/packages/forms/src/patterns/page-set/submit.ts b/packages/forms/src/patterns/pages/submit.ts similarity index 94% rename from packages/forms/src/patterns/page-set/submit.ts rename to packages/forms/src/patterns/pages/submit.ts index 6ac7b401..90d083f2 100644 --- a/packages/forms/src/patterns/page-set/submit.ts +++ b/packages/forms/src/patterns/pages/submit.ts @@ -4,9 +4,9 @@ import { getPatternConfig, getPatternSafely, validatePatternAndChildren, -} from '../../pattern'; -import { type FormSession } from '../../session'; -import { type SubmitHandler } from '../../submission'; +} from '../../../pattern'; +import { type FormSession } from '../../../session'; +import { type SubmitHandler } from '../../../submission'; import { type PagePattern } from '../page/config'; import { type PageSetPattern } from './config'; diff --git a/packages/forms/src/services/submit-form.test.ts b/packages/forms/src/services/submit-form.test.ts index 17fee40f..b1ccc52a 100644 --- a/packages/forms/src/services/submit-form.test.ts +++ b/packages/forms/src/services/submit-form.test.ts @@ -8,14 +8,14 @@ import { } from '../documents/__tests__/test-documents.js'; import { createFormSession } from '../session.js'; import { createForm } from '../blueprint.js'; -import { type PageSetPattern } from '../patterns/page-set/config.js'; -import { type PagePattern } from '../patterns/page/config.js'; +import { type PageSetPattern } from '../patterns/pages/page-set/config.js'; +import { type PagePattern } from '../patterns/pages/page/config.js'; import { type InputPattern } from '../patterns/input/config.js'; import { type Blueprint } from '../types.js'; import { Checkbox } from '../patterns/checkbox.js'; import { FieldSet } from '../patterns/fieldset/builder.js'; -import { Page } from '../patterns/page/builder.js'; -import { Form, PageSet } from '../patterns/page-set/builder.js'; +import { Page } from '../patterns/pages/page/builder.js'; +import { Form, PageSet } from '../patterns/pages/page-set/builder.js'; describe('submitForm', () => { it('fails with missing action string', async () => { diff --git a/packages/forms/src/services/submit-form.ts b/packages/forms/src/services/submit-form.ts index ef917b79..bd77c09e 100644 --- a/packages/forms/src/services/submit-form.ts +++ b/packages/forms/src/services/submit-form.ts @@ -1,7 +1,7 @@ import { failure, success, type Result } from '@atj/common'; import { type FormServiceContext } from '../context/index.js'; -import { submitPage } from '../patterns/page-set/submit'; +import { submitPage } from '../patterns/pages/submit'; import { downloadPackageHandler } from '../patterns/package-download/submit'; import { type FormRoute } from '../route-data.js'; import { SubmissionRegistry } from '../submission';