@pipelex/mthds-form 0.33.0 → 0.34.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 (34) hide show
  1. package/dist/brand/index.js +2 -2
  2. package/dist/{chunk-UKTYADY3.js → chunk-5RV3ASMO.js} +141 -69
  3. package/dist/chunk-5RV3ASMO.js.map +1 -0
  4. package/dist/{chunk-VH5CDQDR.js → chunk-AURDKAIC.js} +3 -3
  5. package/dist/{chunk-VH5CDQDR.js.map → chunk-AURDKAIC.js.map} +1 -1
  6. package/dist/{chunk-ZX52CQJ4.js → chunk-CFBK7NO7.js} +3 -3
  7. package/dist/{chunk-ZX52CQJ4.js.map → chunk-CFBK7NO7.js.map} +1 -1
  8. package/dist/{chunk-3GO65HWP.js → chunk-PNNWNRPG.js} +11 -7
  9. package/dist/chunk-PNNWNRPG.js.map +1 -0
  10. package/dist/{chunk-XO5OENNF.js → chunk-TF4RTKLH.js} +32 -5
  11. package/dist/chunk-TF4RTKLH.js.map +1 -0
  12. package/dist/{chunk-IBBAJXIO.js → chunk-XIWBKV7T.js} +3 -3
  13. package/dist/{chunk-IBBAJXIO.js.map → chunk-XIWBKV7T.js.map} +1 -1
  14. package/dist/{chunk-4SRSGZWM.js → chunk-XYS5KCXB.js} +158 -31
  15. package/dist/chunk-XYS5KCXB.js.map +1 -0
  16. package/dist/core/gate.js +2 -2
  17. package/dist/core/index.js +4 -4
  18. package/dist/core/readiness.d.ts +34 -1
  19. package/dist/core/readiness.js +1 -1
  20. package/dist/core/seed.js +2 -2
  21. package/dist/core/values.js +2 -2
  22. package/dist/generative/headless/index.d.ts +15 -9
  23. package/dist/generative/headless/index.js +3 -2
  24. package/dist/generative/index.d.ts +27 -4
  25. package/dist/generative/index.js +628 -240
  26. package/dist/generative/index.js.map +1 -1
  27. package/dist/react/index.d.ts +30 -3
  28. package/dist/react/index.js +4 -4
  29. package/dist/styles.css +1 -1
  30. package/package.json +1 -1
  31. package/dist/chunk-3GO65HWP.js.map +0 -1
  32. package/dist/chunk-4SRSGZWM.js.map +0 -1
  33. package/dist/chunk-UKTYADY3.js.map +0 -1
  34. package/dist/chunk-XO5OENNF.js.map +0 -1
package/dist/core/gate.js CHANGED
@@ -1,6 +1,6 @@
1
- export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-IBBAJXIO.js';
1
+ export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-XIWBKV7T.js';
2
2
  import '../chunk-E6BIXJ6C.js';
3
- import '../chunk-XO5OENNF.js';
3
+ import '../chunk-TF4RTKLH.js';
4
4
  import '../chunk-Y2ND6W4W.js';
5
5
  import '../chunk-LBFZXYCY.js';
6
6
  import '../chunk-OD3VYXUY.js';
@@ -1,9 +1,9 @@
1
1
  export { planFileSave, planStuffSave } from '../chunk-4VAO6BDE.js';
2
- export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-VH5CDQDR.js';
2
+ export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-AURDKAIC.js';
3
3
  export { addChosenFiles, chosenFilesAdded, roomForChosenFiles, sourceFileValue } from '../chunk-L23R3JNQ.js';
4
4
  export { collectStuffFiles } from '../chunk-56WECFBD.js';
5
5
  export { describeValidationError, displayValue, valueAtProperty } from '../chunk-RPA7DNSK.js';
6
- export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-ZX52CQJ4.js';
6
+ export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-CFBK7NO7.js';
7
7
  export { enumValueLabeler, humanizeEnumValue, humanizeFieldName } from '../chunk-GHVVULHY.js';
8
8
  export { narrowFileFormats } from '../chunk-CAKQ5VFT.js';
9
9
  export { NATIVE_CHOICE_CONCEPT_REF, NATIVE_COMPOSITE_CONCEPT_REF, NATIVE_DATE_CONCEPT_REF, NATIVE_HTML_CONCEPT_REF, NATIVE_PAGE_CONCEPT_REF, NATIVE_RATING_CONCEPT_REF, NATIVE_SEARCH_RESULT_CONCEPT_REF, NATIVE_YES_NO_CONCEPT_REF, TYPED_SCALAR_MARKERS, citedSource, formatDateContent, hasTypedScalarMarkers, isNativeCompositeNode, isNativeDateNode, isNativeHtmlNode, isNativePageNode, isNativeSearchResultNode, isViewableUrl, nativeVerdictOf, readChoiceContent, readCompositeContent, readDataUrl, readDateContent, readDocumentContent, readHtmlContent, readImageContent, readPageContent, readRatingContent, readSearchResultContent, readYesNoContent, splitCitations, viewableUrl } from '../chunk-QQK6Y55E.js';
@@ -11,9 +11,9 @@ export { getPipeOutputForm } from '../chunk-JIGRWJTV.js';
11
11
  export { buildResultField, buildRunFields, getPipeInputForm } from '../chunk-ZB4RYUKV.js';
12
12
  export { conceptCategory } from '../chunk-FABY3DEY.js';
13
13
  export { DOCUMENT_FORMATS, IMAGE_FORMATS, acceptLabel, acceptMap, formatsForKind, isAcceptedFile } from '../chunk-XCO6GTEC.js';
14
- export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-IBBAJXIO.js';
14
+ export { apiInputsFromSchemaData, buildRunInputsSchema, gateRunInputs, prepareRunInputs, validateRunInputs } from '../chunk-XIWBKV7T.js';
15
15
  export { deflateAllInputs, deflateInput, healStringWrappers, inflateAllInputs, inflateInput, pruneEmptyOptionals, resolveConceptCode } from '../chunk-E6BIXJ6C.js';
16
- export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional } from '../chunk-XO5OENNF.js';
16
+ export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional } from '../chunk-TF4RTKLH.js';
17
17
  import '../chunk-Y2ND6W4W.js';
18
18
  export { normalizeSchemaForRjsf, prepareSchemaForRjsf } from '../chunk-LBFZXYCY.js';
19
19
  export { collapseNullable, collectSchemaDefs, derefSchema, flattenAnyOf, hoistDefsToRoot, resolveSchemaIndirection, schemaTypeOf } from '../chunk-OD3VYXUY.js';
@@ -88,6 +88,39 @@ declare function mustBeFilled(field: RunField): boolean;
88
88
  * things stand between me and Run", which is the number a host is displaying.
89
89
  */
90
90
  declare function computeReadiness(fields: RunField[], values: Record<string, unknown>): Readiness;
91
+ /**
92
+ * The top-level fields that stand between the current values and a run, as
93
+ * fields rather than names, in the descriptor's order: the inputs
94
+ * `computeReadiness` counts as missing. A surface that names them in its own
95
+ * words - a humanised label, a run button's description - reads them here, so
96
+ * it names exactly what the count says.
97
+ */
98
+ declare function missingFields(fields: readonly RunField[], values: Record<string, unknown> | undefined): RunField[];
99
+ /**
100
+ * Why the run gate refuses a field, as the structure or the form holding it
101
+ * holds it: a field that must be filled (`mustFill`) and is not is
102
+ * `required`, and a field that need not be but holds something short of what
103
+ * its concept demands is `incomplete`. This is `fieldFilled`'s own rule for a
104
+ * structure's members, so a structure the gate refuses has at least one
105
+ * member it refuses, unless it is a structure that must be touched and holds
106
+ * nothing at all.
107
+ */
108
+ declare function gateRefusal(field: RunField, value: unknown, mustFill: boolean): 'required' | 'incomplete' | undefined;
109
+ /**
110
+ * The fields a person fills to let the run go, at the depth a form draws
111
+ * them: each missing input (`missingFields`), and in place of a structure the
112
+ * members it refuses (`gateRefusal`), at every depth, which is where a form
113
+ * marks them and where a layout that spreads a structure's members over the
114
+ * page puts them. A structure that refuses no member of its own - one that
115
+ * must be touched and holds nothing, with no required member - is itself the
116
+ * field to fill. A list is one field: its rows are the person's own.
117
+ */
118
+ declare function waitingFields(fields: readonly RunField[], values: Record<string, unknown> | undefined): WaitingField[];
119
+ /** A field the run waits for, and the names that lead to it from the inputs, its own last. */
120
+ interface WaitingField {
121
+ field: RunField;
122
+ path: readonly string[];
123
+ }
91
124
  /**
92
125
  * Whether a person should see this field as optional: not required AND carrying no authored
93
126
  * default. The standard marks a defaulted field `required: false` (it can never be missing), but it
@@ -142,4 +175,4 @@ declare function isFoldedOptional(field: RunField, value: unknown): boolean;
142
175
  /** Whether any optional structure among `fields` is open in `values`. */
143
176
  declare function anyOptionalStructureOpen(fields: readonly RunField[], values: Record<string, unknown> | undefined): boolean;
144
177
 
145
- export { type Readiness, anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional };
178
+ export { type Readiness, type WaitingField, anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, gateRefusal, isFilled, isFoldedOptional, isOptionalStructure, missingFields, mustBeFilled, optionalStructureOpen, shownAsOptional, waitingFields };
@@ -1,4 +1,4 @@
1
- export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, isFilled, isFoldedOptional, isOptionalStructure, mustBeFilled, optionalStructureOpen, shownAsOptional } from '../chunk-XO5OENNF.js';
1
+ export { anyOptionalStructureOpen, computeReadiness, fieldFilled, foldsBehindOptionalDisclosure, gateRefusal, isFilled, isFoldedOptional, isOptionalStructure, missingFields, mustBeFilled, optionalStructureOpen, shownAsOptional, waitingFields } from '../chunk-TF4RTKLH.js';
2
2
  import '../chunk-V3OV2XQT.js';
3
3
  //# sourceMappingURL=readiness.js.map
4
4
  //# sourceMappingURL=readiness.js.map
package/dist/core/seed.js CHANGED
@@ -1,5 +1,5 @@
1
- export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-VH5CDQDR.js';
2
- import '../chunk-XO5OENNF.js';
1
+ export { closeOptionalStructures, openOptionalStructures, seedInputs, seedObjectValue } from '../chunk-AURDKAIC.js';
2
+ import '../chunk-TF4RTKLH.js';
3
3
  import '../chunk-V3OV2XQT.js';
4
4
  //# sourceMappingURL=seed.js.map
5
5
  //# sourceMappingURL=seed.js.map
@@ -1,8 +1,8 @@
1
- export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-ZX52CQJ4.js';
1
+ export { apiInputsFromRunValues, fieldsForContract, inputDataFromWorkingMemory, outputsFromPipeOutput, rjsfDataFromRunValues, runValuesFromInputs, runValuesFromStore, sameRunValues, setValueAtPath, storeInputDataFromRunValues } from '../chunk-CFBK7NO7.js';
2
2
  import '../chunk-ZB4RYUKV.js';
3
3
  import '../chunk-XCO6GTEC.js';
4
4
  import '../chunk-E6BIXJ6C.js';
5
- import '../chunk-XO5OENNF.js';
5
+ import '../chunk-TF4RTKLH.js';
6
6
  import '../chunk-OD3VYXUY.js';
7
7
  import '../chunk-WYH56SOZ.js';
8
8
  import '../chunk-V3OV2XQT.js';
@@ -1278,9 +1278,10 @@ declare function designerCatalog({ frame }?: DesignerCatalogOptions): DesignerCa
1278
1278
  * the catalog as data (`designerCatalog({ frame })`). Both are what a run was
1279
1279
  * actually given, so both are hashed - a reworded rule and a renamed prop each
1280
1280
  * move the pin, exactly as they did when the prompt was rendered here. A run
1281
- * is given the catalog of one frame, and the hash covers every frame's in a
1282
- * fixed order: one pin a host compares every stored layout with, whichever
1283
- * frame it was written for, and which any frame's vocabulary moving moves. The frame a
1281
+ * is given the catalog of one frame, and the hash covers the method's text
1282
+ * first and then every frame's catalog, in a fixed order: one pin a host
1283
+ * compares every stored layout with, whichever frame it was written for, and
1284
+ * which a reworded rule or any frame's vocabulary moving moves. The frame a
1284
1285
  * layout was written for is its own provenance, beside the hash. The brief is
1285
1286
  * not hashed: it is the per-method half, recorded with each layout. The model
1286
1287
  * pin in the method file moves it too, since the file is hashed whole; a
@@ -1408,11 +1409,14 @@ interface LayoutVerdict {
1408
1409
  /** Every problem, one a line, in the words the repair pass reads; empty means the layout may render. */
1409
1410
  problems: string[];
1410
1411
  /**
1411
- * Whether a check threw on a layout of the right shape: a defect in the
1412
- * checks, stated among the problems in a line of its own. The layout is
1413
- * refused all the same - the host keeps the plain form - but a producer
1414
- * stops here instead of handing the lines to the repair pass, which can
1415
- * change the layout and not the checks.
1412
+ * Whether no repair of the layout can help: a check threw on a layout of
1413
+ * the right shape, a defect in the checks, or the frame or the descriptor
1414
+ * the layout is checked against is not one, a defect in what the host
1415
+ * handed over. Each
1416
+ * is stated among the problems in a line of its own. The layout is refused
1417
+ * all the same - the host keeps the plain form - but a producer stops here
1418
+ * instead of handing the lines to the repair pass, which can change the
1419
+ * layout and neither the checks nor the descriptor.
1416
1420
  */
1417
1421
  checksFailed: boolean;
1418
1422
  }
@@ -1432,7 +1436,9 @@ interface LayoutVerdict {
1432
1436
  * page to its fallback. So a frame this package does not draw, a missing or
1433
1437
  * misshapen descriptor, and anything not shaped like a spec are each a
1434
1438
  * problem line, and a throw left in a walk below on a layout of the right
1435
- * shape is the checks' own failure: a line saying so, and `checksFailed`.
1439
+ * shape is the checks' own failure, a line saying so. The frame and the
1440
+ * descriptor are the host's, and a throw is the checks', so each of those
1441
+ * sets `checksFailed` too: no repair of the layout can mend it.
1436
1442
  * The shape is checked once, before either check walks the layout.
1437
1443
  */
1438
1444
  declare function layoutCheck(spec: Spec, { frame, descriptor }: LayoutCheck): LayoutVerdict;
@@ -1,6 +1,7 @@
1
- export { COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, FRAMES, FRAME_COMPONENTS, ICON_NAMES, INPUTS_ROOT, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheck, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog } from '../../chunk-4SRSGZWM.js';
1
+ export { COMPONENT_NAMES, COMPONENT_RENDERINGS, COMPOSER_COMPONENTS, CUSTOM_COMPONENTS, DESIGNER_BRIEF_CONCEPT, DESIGNER_CATALOG_CONCEPT, FRAMES, FRAME_COMPONENTS, ICON_NAMES, INPUTS_ROOT, METRIC_FORMATS, PICKED_SHADCN, PRODUCT_COMPONENTS, PROMPT_HASH, REPAIR_ATTEMPTS, RESULT_COMPONENTS, RESULT_ROOT, absoluteHatchPath, catalog, componentNamesFor, designerCatalog, fieldAtSegments, findFixture, fixtureId, fixtureLabel, formatProblems, frameCatalog, inputBrief, inputFieldAtPath, isDelegatedInput, isDelegatedResult, joinPath, jsonlLines, layoutCheck, layoutCheckProblems, layoutFits, layoutProblems, payloadToState, promptHashSubject, repeatBasePathOf, resultBrief, resultFieldAtPath, seedLine, segmentsUnder, specFromJsonl, specToJsonl, validateAgainstCatalog } from '../../chunk-XYS5KCXB.js';
2
2
  import '../../chunk-QQK6Y55E.js';
3
- import '../../chunk-3GO65HWP.js';
3
+ import '../../chunk-PNNWNRPG.js';
4
+ import '../../chunk-TF4RTKLH.js';
4
5
  import '../../chunk-V3OV2XQT.js';
5
6
  //# sourceMappingURL=index.js.map
6
7
  //# sourceMappingURL=index.js.map
@@ -802,16 +802,39 @@ declare function useStoreSnapshot(store: StateStore): StateModel;
802
802
  */
803
803
  declare const generativeRegistry: _json_render_react.ComponentRegistry;
804
804
 
805
+ /**
806
+ * A panel that can be hidden - a tab's, a step's, a closed section's - as a
807
+ * refused run sees it: `open` shows this panel, and the reveal it hands its
808
+ * contents opens the panels around it first. The reveal handed down keeps its
809
+ * identity across renders, so no field re-renders when its panel does.
810
+ */
811
+ declare function RevealPanel({ open, children }: {
812
+ open: () => void;
813
+ children: React.ReactNode;
814
+ }): React.JSX.Element;
815
+ /** What `useCheckedField` gives a control: json-render's field validation, and where the focus goes. */
816
+ type CheckedField = ReturnType<typeof useFieldValidation> & {
817
+ /**
818
+ * A ref for the element a refused run puts the focus on: the input, the
819
+ * select's trigger, a radio group's checked option or its first while none
820
+ * is. A control that attaches it is focused when it is the first failing
821
+ * field of a refused run; one that does not is still revealed, after every
822
+ * field that does.
823
+ */
824
+ focusRef: (element: HTMLElement | null) => void;
825
+ };
805
826
  /**
806
827
  * json-render's `useFieldValidation`, for a control that carries checks. On a
807
828
  * page, the field's checks enter the page's record while it is mounted, and
808
829
  * the field validates against every check its path carries, so a control
809
830
  * hidden or dropped no longer holds the run and two controls on one path
810
- * agree. A host's own control that carries checks calls this rather than
811
- * `useFieldValidation` to be held to the same rules; outside a page it is
831
+ * agree; and when a run is refused, the first failing field is revealed and
832
+ * focused. A host's own control that carries checks calls this rather than
833
+ * `useFieldValidation` to be held to the same rules, and attaches `focusRef`
834
+ * to the element that should take the focus; outside a page it is
812
835
  * `useFieldValidation`.
813
836
  */
814
- declare function useCheckedField(path: string, config: ValidationConfig | undefined): ReturnType<typeof useFieldValidation>;
837
+ declare function useCheckedField(path: string, config: ValidationConfig | undefined): CheckedField;
815
838
 
816
839
  /**
817
840
  * What the page paints under the work column, when there is anything to paint.
@@ -880,4 +903,4 @@ declare function FrameHostProvider({ host, children, }: {
880
903
  }): React.JSX.Element;
881
904
  declare function useFrameHost(): FrameHost;
882
905
 
883
- export { BrandBar, type BrandBarProps, BrandManifest, BrandProvider, DescriptorProvider, type DescriptorScope, type ElementErrorHandler, type ElementErrorInfo, type FrameHost, FrameHostProvider, GenerativePage, type GenerativePageProps, type PageRegistry, type ResultSlot, ResultSlotProvider, domIdFor, generativeRegistry, generativeRenderers, pathFromDomId, useBrand, useCheckedField, useDescriptorScope, useFrameHost, useResultSlot, useStoreSnapshot };
906
+ export { BrandBar, type BrandBarProps, BrandManifest, BrandProvider, type CheckedField, DescriptorProvider, type DescriptorScope, type ElementErrorHandler, type ElementErrorInfo, type FrameHost, FrameHostProvider, GenerativePage, type GenerativePageProps, type PageRegistry, type ResultSlot, ResultSlotProvider, RevealPanel, domIdFor, generativeRegistry, generativeRenderers, pathFromDomId, useBrand, useCheckedField, useDescriptorScope, useFrameHost, useResultSlot, useStoreSnapshot };