@aglyn/plugins-forms 1.23.1 → 1.25.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-forms",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.
|
|
29
|
-
"@aglyn/shared-data-enums": "1.
|
|
30
|
-
"@aglyn/shared-data-mdi": "1.
|
|
31
|
-
"@aglyn/shared-ui-jsx": "1.
|
|
32
|
-
"@aglyn/shared-ui-jsx-forms": "1.
|
|
33
|
-
"@aglyn/shared-ui-snackstack": "1.
|
|
34
|
-
"@aglyn/shared-util-email": "1.
|
|
35
|
-
"@aglyn/shared-util-http": "1.
|
|
36
|
-
"@aglyn/shared-util-timestamp": "1.
|
|
37
|
-
"@aglyn/shared-util-tools": "1.
|
|
38
|
-
"@aglyn/tenant-data-admin": "1.
|
|
39
|
-
"@aglyn/tenant-feature-instance": "1.
|
|
40
|
-
"@aglyn/tenant-runtime": "1.
|
|
28
|
+
"@aglyn/aglyn": "1.25.0",
|
|
29
|
+
"@aglyn/shared-data-enums": "1.25.0",
|
|
30
|
+
"@aglyn/shared-data-mdi": "1.25.0",
|
|
31
|
+
"@aglyn/shared-ui-jsx": "1.25.0",
|
|
32
|
+
"@aglyn/shared-ui-jsx-forms": "1.25.0",
|
|
33
|
+
"@aglyn/shared-ui-snackstack": "1.25.0",
|
|
34
|
+
"@aglyn/shared-util-email": "1.25.0",
|
|
35
|
+
"@aglyn/shared-util-http": "1.25.0",
|
|
36
|
+
"@aglyn/shared-util-timestamp": "1.25.0",
|
|
37
|
+
"@aglyn/shared-util-tools": "1.25.0",
|
|
38
|
+
"@aglyn/tenant-data-admin": "1.25.0",
|
|
39
|
+
"@aglyn/tenant-feature-instance": "1.25.0",
|
|
40
|
+
"@aglyn/tenant-runtime": "1.25.0",
|
|
41
41
|
"@swc/helpers": "0.5.24"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -91,6 +91,10 @@ const LEGACY_FIELD_TYPES = new Set([
|
|
|
91
91
|
return (typeof options === 'string' ? options : '').split(/[\n,]/).map((entry)=>entry.trim()).filter(Boolean);
|
|
92
92
|
}
|
|
93
93
|
/** Child ids of a stored node, in order. */ const childIds = (node)=>Array.isArray(node == null ? void 0 : node.nodes) ? node == null ? void 0 : node.nodes : [];
|
|
94
|
+
/** An option that only says yes: on a lone box it is the answer, not the question. */ const BARE_AFFIRMATIVE = /^(yes|y|ok|okay|true|on|agree|i agree)[.!]?$/i;
|
|
95
|
+
function isBareAffirmative(option) {
|
|
96
|
+
return BARE_AFFIRMATIVE.test(option.trim());
|
|
97
|
+
}
|
|
94
98
|
/**
|
|
95
99
|
* The all-in-one `formField` node `node`, rebuilt as MUI's separate form
|
|
96
100
|
* elements — or `null` when it is not one.
|
|
@@ -223,9 +227,14 @@ const LEGACY_FIELD_TYPES = new Set([
|
|
|
223
227
|
// A lone box is its own question: the words beside it say it all. A
|
|
224
228
|
// group of boxes keeps the question above them.
|
|
225
229
|
if (options.length !== 1) addLabel();
|
|
230
|
+
// A lone box whose one option is only a yes-word ("Yes") was asked by
|
|
231
|
+
// its field label ("Email me news and updates"): those are the words a
|
|
232
|
+
// visitor needs beside the box, where "Yes" alone says nothing. It
|
|
233
|
+
// still posts the option, so a consent box reads as ticked as before.
|
|
234
|
+
const loneWords = options.length === 1 && label && isBareAffirmative(options[0]) ? label : undefined;
|
|
226
235
|
options.forEach((option, index)=>{
|
|
227
236
|
const choice = add(mint(`${id}-opt-${index}`), id, FORM_FIELD_ELEMENT_IDS.choiceLabel, {
|
|
228
|
-
label: option
|
|
237
|
+
label: loneWords != null ? loneWords : option
|
|
229
238
|
});
|
|
230
239
|
// `value` is the option text, as the all-in-one element posted it —
|
|
231
240
|
// which is also what makes a single-option marketing consent box
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/forms/src/lib/model/form-field-elements.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * ONE ALL-IN-ONE FORM FIELD, REBUILT FROM MUI'S SEPARATE FORM ELEMENTS.\n *\n * Every piece of a field is its own Besigner element now (a Form Control\n * holding a Form Label and an Input, a Select of Select Options, a Radio Group\n * of Radios in Choice Labels, Checkboxes in Choice Labels, a Rating), so an\n * author selects and styles each piece with the ordinary Styles panel. The\n * all-in-one `formField` is still registered so a document nobody has migrated\n * keeps drawing, and this module is how each one is moved off it: the seeds,\n * the presets and `tools/scripts/backfill-formfield-elements.mjs` all build the\n * same tree from the same rules.\n *\n * What must survive the move, exactly:\n *\n * - **The field's id.** It stays on the Form Control wrapper, so a parent's\n * `nodes` list, a reveal target and every placement override keyed by it\n * still find the field. The wrapper takes the field's `sx` with it.\n * - **The name it submits under.** Contact-field mappings, dataset bindings\n * and the consent field all key on it, so it is copied verbatim.\n * - **Everything a placement overrode.** A placed form's `attrOverrides`\n * named the field's id and a prop of the all-in-one element; the slice is\n * re-keyed onto the piece that now owns that prop.\n *\n * It lives with the forms plugin, which owns the all-in-one element, rather\n * than in core: a form's vocabulary is the plugin's domain (docs/PACKAGES.md\n * rule 3).\n *\n * Pure and dependency-free (no imports at all) on purpose: the backfill is a\n * plain Node script that imports this file directly from its TypeScript\n * source, and an import here would drag a package graph into it.\n */\n\n/** A node as it is stored: a flat map entry with its children by id. */\nexport interface StoredFormNode {\n $id?: string\n componentId?: string\n pluginId?: string\n parentId?: string | null\n props?: Record<string, unknown>\n nodes?: string[]\n sx?: unknown\n [key: string]: unknown\n}\n\n/** The all-in-one element this module migrates away from. Persisted; never rename. */\nexport const LEGACY_FORM_FIELD_COMPONENT_ID = 'formField'\n\n/** The bundle that registers every element a field is rebuilt from. */\nexport const FORM_FIELD_ELEMENTS_PLUGIN_ID = 'mui'\n\n/**\n * MUI's form elements, by persisted component id — restated rather than\n * imported (see the module note; a plugin never imports another plugin).\n * `form-field-elements.spec.ts` holds this table equal to core's\n * `FORM_INPUT_ELEMENT_IDS` in `forms.ts`.\n */\nexport const FORM_FIELD_ELEMENT_IDS = {\n formControl: 'muiFormControl',\n formLabel: 'muiFormLabel',\n input: 'muiInput',\n select: 'muiSelect',\n selectOption: 'muiSelectOption',\n radioGroup: 'muiRadioGroup',\n radio: 'muiRadio',\n checkbox: 'muiCheckbox',\n choiceLabel: 'muiFormControlLabel',\n rating: 'muiRating',\n datePicker: 'muiDatePicker',\n timePicker: 'muiTimePicker',\n} as const\n\n/** The all-in-one element's types; anything else drew as a one-line text box. */\ntype LegacyFieldType =\n | 'text'\n | 'email'\n | 'textarea'\n | 'select'\n | 'radio'\n | 'checkbox'\n | 'rating'\n\nconst LEGACY_FIELD_TYPES = new Set<string>([\n 'text',\n 'email',\n 'textarea',\n 'select',\n 'radio',\n 'checkbox',\n 'rating',\n])\n\n/** The props the all-in-one element read; anything else rode onto its root. */\nconst LEGACY_FIELD_PROPS = new Set<string>([\n 'fieldName',\n 'datasetFieldId',\n 'label',\n 'placeholder',\n 'fieldType',\n 'options',\n 'required',\n])\n\n/**\n * A choice list as the all-in-one element split it: newline- or\n * comma-separated, trimmed, empties dropped (its own `parseFieldOptions`).\n */\nexport function parseLegacyFieldOptions(options: unknown): string[] {\n return (typeof options === 'string' ? options : '')\n .split(/[\\n,]/)\n .map((entry) => entry.trim())\n .filter(Boolean)\n}\n\n/** Which new node owns each prop the all-in-one element had. */\nexport interface FormFieldElementsLayout {\n /** The Form Control; the field's own id. */\n rootId: string\n /** The Form Label, when the field has one (not a lone checkbox). */\n labelId?: string\n /** Every node that submits the answer and carries `name`. */\n answerIds: string[]\n /** The nodes a placeholder belongs on (Input, Select). */\n placeholderIds: string[]\n /** The nodes `required` is enforced on. */\n requiredIds: string[]\n}\n\nexport interface FormFieldElements extends FormFieldElementsLayout {\n /** The wrapper and every new node under it, keyed by id. */\n nodes: Record<string, StoredFormNode>\n}\n\n/** Child ids of a stored node, in order. */\nconst childIds = (node: StoredFormNode | undefined): string[] =>\n Array.isArray(node?.nodes) ? (node?.nodes as string[]) : []\n\n/**\n * The all-in-one `formField` node `node`, rebuilt as MUI's separate form\n * elements — or `null` when it is not one.\n *\n * `nodes` is the tree it sits in, read only so a new id never collides with\n * one already there. New ids are derived from the field's own\n * (`<id>-label`, `<id>-input`, `<id>-opt-0`, `<id>-opt-0-input`), so a\n * second run over the same field mints the same tree.\n */\nexport function formFieldToElements(\n node: StoredFormNode | undefined | null,\n nodes: Record<string, StoredFormNode | undefined> = {},\n): FormFieldElements | null {\n if (!node || node.componentId !== LEGACY_FORM_FIELD_COMPONENT_ID) return null\n const id = String(node.$id ?? '')\n if (!id) return null\n\n const props = (node.props ?? {}) as Record<string, unknown>\n const rawName = props['fieldName']\n // Exactly what the element submitted under: `fieldName || 'field'`.\n const name = rawName === undefined || rawName === null || rawName === ''\n ? 'field'\n : String(rawName)\n const label =\n String(props['label'] || '') || String(rawName || '') || 'Field'\n const rawType = String(props['fieldType'] ?? 'text')\n const fieldType = (\n LEGACY_FIELD_TYPES.has(rawType) ? rawType : 'text'\n ) as LegacyFieldType\n const placeholder =\n typeof props['placeholder'] === 'string' && props['placeholder'].trim()\n ? (props['placeholder'] as string)\n : undefined\n const required = Boolean(props['required'])\n const datasetFieldId =\n typeof props['datasetFieldId'] === 'string' && props['datasetFieldId'].trim()\n ? (props['datasetFieldId'] as string)\n : undefined\n const options = parseLegacyFieldOptions(props['options'])\n\n // Whatever else the author's props held rode onto the element's root, so\n // it rides onto the wrapper.\n const rest: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(props)) {\n if (!LEGACY_FIELD_PROPS.has(key)) rest[key] = value\n }\n\n const taken = new Set<string>(Object.keys(nodes))\n taken.delete(id)\n const mint = (base: string): string => {\n let candidate = base\n for (let n = 2; taken.has(candidate); n += 1) candidate = `${base}-${n}`\n taken.add(candidate)\n return candidate\n }\n\n const out: Record<string, StoredFormNode> = {}\n const typed = node.type !== undefined ? { type: node.type } : {}\n const add = (\n nodeId: string,\n parentId: string,\n componentId: string,\n nodeProps: Record<string, unknown>,\n ): string => {\n out[nodeId] = {\n $id: nodeId,\n ...typed,\n componentId,\n pluginId: FORM_FIELD_ELEMENTS_PLUGIN_ID,\n parentId,\n props: nodeProps,\n }\n const parent = out[parentId]\n if (parent) parent.nodes = [...childIds(parent), nodeId]\n return nodeId\n }\n const mapping = datasetFieldId ? { datasetFieldId } : {}\n const req = required ? { required: true } : {}\n\n const fullWidth =\n fieldType === 'text' ||\n fieldType === 'email' ||\n fieldType === 'textarea' ||\n fieldType === 'select'\n const { nodes: _ownChildren, props: _props, ...shell } = node\n out[id] = {\n ...shell,\n componentId: FORM_FIELD_ELEMENT_IDS.formControl,\n pluginId: FORM_FIELD_ELEMENTS_PLUGIN_ID,\n props: {\n ...rest,\n ...(fullWidth ? { fullWidth: true } : {}),\n ...req,\n },\n nodes: [],\n }\n\n const layout: FormFieldElementsLayout = {\n rootId: id,\n answerIds: [],\n placeholderIds: [],\n requiredIds: [],\n }\n const addLabel = () => {\n layout.labelId = add(mint(`${id}-label`), id, FORM_FIELD_ELEMENT_IDS.formLabel, {\n children: label,\n })\n }\n\n switch (fieldType) {\n case 'select': {\n addLabel()\n const select = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.select, {\n name,\n ...(placeholder ? { placeholder } : {}),\n ...req,\n fullWidth: true,\n ...mapping,\n })\n options.forEach((option, index) => {\n add(mint(`${id}-opt-${index}`), select, FORM_FIELD_ELEMENT_IDS.selectOption, {\n children: option,\n })\n })\n layout.answerIds.push(select)\n layout.placeholderIds.push(select)\n layout.requiredIds.push(select)\n break\n }\n case 'radio': {\n addLabel()\n const group = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.radioGroup, {\n name,\n ...mapping,\n })\n options.forEach((option, index) => {\n const choice = add(\n mint(`${id}-opt-${index}`),\n group,\n FORM_FIELD_ELEMENT_IDS.choiceLabel,\n { label: option },\n )\n const radio = add(mint(`${id}-opt-${index}-input`), choice, FORM_FIELD_ELEMENT_IDS.radio, {\n value: option,\n ...req,\n })\n layout.requiredIds.push(radio)\n })\n layout.answerIds.push(group)\n break\n }\n case 'checkbox': {\n // A lone box is its own question: the words beside it say it all. A\n // group of boxes keeps the question above them.\n if (options.length !== 1) addLabel()\n options.forEach((option, index) => {\n const choice = add(\n mint(`${id}-opt-${index}`),\n id,\n FORM_FIELD_ELEMENT_IDS.choiceLabel,\n { label: option },\n )\n // `value` is the option text, as the all-in-one element posted it —\n // which is also what makes a single-option marketing consent box\n // read as ticked (`isConsentCheckboxTicked`). `required` only on a\n // lone box: on a group it meant \"at least one\", which a box of its\n // own cannot say.\n const box = add(mint(`${id}-opt-${index}-input`), choice, FORM_FIELD_ELEMENT_IDS.checkbox, {\n name,\n value: option,\n ...(options.length === 1 ? req : {}),\n ...mapping,\n })\n layout.answerIds.push(box)\n if (options.length === 1) layout.requiredIds.push(box)\n })\n break\n }\n case 'rating': {\n addLabel()\n const rating = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.rating, {\n name,\n ...mapping,\n })\n layout.answerIds.push(rating)\n break\n }\n default: {\n addLabel()\n const input = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.input, {\n name,\n type: fieldType === 'email' ? 'email' : 'text',\n ...(fieldType === 'textarea' ? { multiline: true, minRows: 3 } : {}),\n ...(placeholder ? { placeholder } : {}),\n ...req,\n fullWidth: true,\n ...mapping,\n })\n layout.answerIds.push(input)\n layout.placeholderIds.push(input)\n layout.requiredIds.push(input)\n }\n }\n\n // A self-closing field never had children, but one that somehow did keeps\n // them rather than orphaning them.\n const wrapper = out[id] as StoredFormNode\n wrapper.nodes = [...childIds(wrapper), ...childIds(node)]\n return { ...layout, nodes: out }\n}\n\n/**\n * Every all-in-one field in a tree, rebuilt — or `null` when the tree holds\n * none. The tree is not mutated; the result is a new map with each field\n * replaced in place (same id) and its new pieces added.\n */\nexport function migrateFormFieldNodes(\n nodes: Record<string, StoredFormNode | undefined> | null | undefined,\n): { nodes: Record<string, StoredFormNode>; converted: string[] } | null {\n if (!nodes || typeof nodes !== 'object') return null\n const next: Record<string, StoredFormNode> = { ...(nodes as Record<string, StoredFormNode>) }\n const converted: string[] = []\n for (const [key, node] of Object.entries(nodes)) {\n if (!node || node.componentId !== LEGACY_FORM_FIELD_COMPONENT_ID) continue\n const elements = formFieldToElements({ ...node, $id: node.$id ?? key }, next)\n if (!elements) continue\n Object.assign(next, elements.nodes)\n converted.push(key)\n }\n return converted.length ? { nodes: next, converted } : null\n}\n\n/**\n * Which piece owns each prop of the field at `id` in a DEFINITION tree,\n * whether that tree still holds the all-in-one element or already holds its\n * replacement — so re-keying a placement works before and after the design\n * itself was migrated, and a re-run never double-moves anything.\n */\nexport function formFieldLayoutIn(\n definition: Record<string, StoredFormNode | undefined>,\n id: string,\n): FormFieldElementsLayout | null {\n const node = definition[id]\n if (!node) return null\n if (node.componentId === LEGACY_FORM_FIELD_COMPONENT_ID) {\n const elements = formFieldToElements({ ...node, $id: node.$id ?? id }, definition)\n if (!elements) return null\n const { nodes: _nodes, ...layout } = elements\n return layout\n }\n if (node.componentId !== FORM_FIELD_ELEMENT_IDS.formControl) return null\n\n const layout: FormFieldElementsLayout = {\n rootId: id,\n answerIds: [],\n placeholderIds: [],\n requiredIds: [],\n }\n const checkboxes: string[] = []\n const stack = [...childIds(node)].reverse()\n const seen = new Set<string>([id])\n while (stack.length) {\n const childId = stack.pop() as string\n if (seen.has(childId)) continue\n seen.add(childId)\n const child = definition[childId]\n if (!child) continue\n switch (child.componentId) {\n case FORM_FIELD_ELEMENT_IDS.formLabel:\n if (!layout.labelId && child.parentId === id) layout.labelId = childId\n break\n case FORM_FIELD_ELEMENT_IDS.input:\n case FORM_FIELD_ELEMENT_IDS.select:\n layout.answerIds.push(childId)\n layout.placeholderIds.push(childId)\n layout.requiredIds.push(childId)\n break\n case FORM_FIELD_ELEMENT_IDS.radioGroup:\n case FORM_FIELD_ELEMENT_IDS.rating:\n layout.answerIds.push(childId)\n break\n case FORM_FIELD_ELEMENT_IDS.radio:\n layout.requiredIds.push(childId)\n break\n case FORM_FIELD_ELEMENT_IDS.checkbox:\n layout.answerIds.push(childId)\n checkboxes.push(childId)\n break\n default:\n break\n }\n const children = childIds(child)\n for (let index = children.length - 1; index >= 0; index -= 1) {\n stack.push(children[index] as string)\n }\n }\n if (checkboxes.length === 1) layout.requiredIds.push(checkboxes[0] as string)\n return layout\n}\n\n/** A placement override that had nowhere to go, reported rather than kept. */\nexport interface DroppedFormFieldOverride {\n key: string\n prop: string\n}\n\n/**\n * A placement's `attrOverrides` re-keyed for MUI's separate form elements, or\n * `null` when nothing in it named an all-in-one field's props.\n *\n * `overrides` is keyed by DEFINITION node ids (a placed form's design, a\n * reusable component's definition). A slice keyed by a field's id moves:\n * `label` onto the Form Label (as its text), `placeholder` onto the Input or\n * Select, `fieldName` onto every answer element (as `name`), `required` onto\n * the elements that enforce it and the wrapper, `datasetFieldId` onto the\n * answer elements. Anything else in the slice (`sx` among it) stays on the\n * field's id, which is the wrapper. `fieldType` and `options` re-shape the\n * field itself and have no single new home; they are dropped and returned so\n * the caller can report them.\n */\nexport function rekeyFormFieldOverrides(\n overrides: unknown,\n definition: Record<string, StoredFormNode | undefined> | null | undefined,\n): {\n attrOverrides: Record<string, Record<string, unknown>>\n moved: number\n dropped: DroppedFormFieldOverride[]\n} | null {\n if (!overrides || typeof overrides !== 'object' || Array.isArray(overrides)) return null\n if (!definition) return null\n const source = overrides as Record<string, unknown>\n const next: Record<string, Record<string, unknown>> = {}\n for (const [key, slice] of Object.entries(source)) {\n if (slice && typeof slice === 'object' && !Array.isArray(slice)) {\n next[key] = { ...(slice as Record<string, unknown>) }\n }\n }\n const put = (targetId: string, prop: string, value: unknown) => {\n next[targetId] = { ...(next[targetId] ?? {}), [prop]: value }\n }\n let moved = 0\n const dropped: DroppedFormFieldOverride[] = []\n for (const [key, slice] of Object.entries(source)) {\n if (!slice || typeof slice !== 'object' || Array.isArray(slice)) continue\n const own = slice as Record<string, unknown>\n if (!Object.keys(own).some((prop) => LEGACY_FIELD_PROPS.has(prop))) continue\n const layout = formFieldLayoutIn(definition, key)\n if (!layout) continue\n const kept: Record<string, unknown> = {}\n for (const [prop, value] of Object.entries(own)) {\n switch (prop) {\n case 'label':\n if (layout.labelId) put(layout.labelId, 'children', value)\n else dropped.push({ key, prop })\n break\n case 'placeholder':\n if (layout.placeholderIds.length) {\n for (const target of layout.placeholderIds) put(target, 'placeholder', value)\n } else dropped.push({ key, prop })\n break\n case 'fieldName':\n if (layout.answerIds.length) {\n for (const target of layout.answerIds) put(target, 'name', value)\n } else dropped.push({ key, prop })\n break\n case 'datasetFieldId':\n if (layout.answerIds.length) {\n for (const target of layout.answerIds) put(target, 'datasetFieldId', value)\n } else dropped.push({ key, prop })\n break\n case 'required':\n kept['required'] = value\n for (const target of layout.requiredIds) put(target, 'required', value)\n break\n case 'fieldType':\n case 'options':\n dropped.push({ key, prop })\n break\n default:\n kept[prop] = value\n }\n }\n moved += 1\n // The wrapper's slice is rebuilt from what stayed, merged over anything\n // a re-key of ANOTHER field put there (none can — ids are per field —\n // but the merge keeps the rule obvious).\n const { label: _l, placeholder: _p, fieldName: _f, datasetFieldId: _d, fieldType: _t, options: _o, required: _r, ...others } =\n next[key] ?? {}\n const wrapper = { ...others, ...kept }\n if (Object.keys(wrapper).length) next[key] = wrapper\n else delete next[key]\n }\n return moved ? { attrOverrides: next, moved, dropped } : null\n}\n\n/**\n * The MUI class names a stored `sx` (or a style override slice) selects, such\n * as `& .MuiInputLabel-root` or `& .MuiOutlinedInput-notchedOutline`.\n *\n * The all-in-one element drew a TextField, so an author's styles could reach\n * into its inner classes. After the move a field is separate elements whose\n * own classes differ (`MuiFormLabel`, not `MuiInputLabel`), so such a\n * selector may match nothing; the backfill lists every one for a person to\n * restate on the right element.\n */\nexport function muiClassSelectorsIn(sx: unknown): string[] {\n const found = new Set<string>()\n const visit = (value: unknown, depth: number) => {\n if (!value || typeof value !== 'object' || depth > 8) return\n for (const [key, entry] of Object.entries(value as Record<string, unknown>)) {\n for (const match of key.matchAll(/Mui[A-Z][A-Za-z]*(?:-[A-Za-z]+)?/g)) {\n found.add(match[0])\n }\n visit(entry, depth + 1)\n }\n }\n visit(sx, 0)\n return [...found].sort()\n}\n"],"names":["LEGACY_FORM_FIELD_COMPONENT_ID","FORM_FIELD_ELEMENTS_PLUGIN_ID","FORM_FIELD_ELEMENT_IDS","formControl","formLabel","input","select","selectOption","radioGroup","radio","checkbox","choiceLabel","rating","datePicker","timePicker","LEGACY_FIELD_TYPES","Set","LEGACY_FIELD_PROPS","parseLegacyFieldOptions","options","split","map","entry","trim","filter","Boolean","childIds","node","Array","isArray","nodes","formFieldToElements","props","componentId","id","String","$id","rawName","name","undefined","label","rawType","fieldType","has","placeholder","required","datasetFieldId","rest","key","value","Object","entries","taken","keys","delete","mint","base","candidate","n","add","out","typed","type","nodeId","parentId","nodeProps","pluginId","parent","mapping","req","fullWidth","_ownChildren","_props","shell","layout","rootId","answerIds","placeholderIds","requiredIds","addLabel","labelId","children","forEach","option","index","push","group","choice","length","box","multiline","minRows","wrapper","migrateFormFieldNodes","next","converted","elements","assign","formFieldLayoutIn","definition","_nodes","checkboxes","stack","reverse","seen","childId","pop","child","rekeyFormFieldOverrides","overrides","source","slice","put","targetId","prop","moved","dropped","own","some","kept","target","_l","_p","fieldName","_f","_d","_t","_o","_r","others","attrOverrides","muiClassSelectorsIn","sx","found","visit","depth","match","matchAll","sort"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BC,GAED,sEAAsE;;AAYtE,oFAAoF,GACpF,OAAO,MAAMA,iCAAiC,YAAW;AAEzD,qEAAqE,GACrE,OAAO,MAAMC,gCAAgC,MAAK;AAElD;;;;;CAKC,GACD,OAAO,MAAMC,yBAAyB;IACpCC,aAAa;IACbC,WAAW;IACXC,OAAO;IACPC,QAAQ;IACRC,cAAc;IACdC,YAAY;IACZC,OAAO;IACPC,UAAU;IACVC,aAAa;IACbC,QAAQ;IACRC,YAAY;IACZC,YAAY;AACd,EAAU;AAYV,MAAMC,qBAAqB,IAAIC,IAAY;IACzC;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,6EAA6E,GAC7E,MAAMC,qBAAqB,IAAID,IAAY;IACzC;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED;;;CAGC,GACD,OAAO,SAASE,wBAAwBC,OAAgB;IACtD,OAAO,AAAC,CAAA,OAAOA,YAAY,WAAWA,UAAU,EAAC,EAC9CC,KAAK,CAAC,SACNC,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI,IACzBC,MAAM,CAACC;AACZ;AAqBA,0CAA0C,GAC1C,MAAMC,WAAW,CAACC,OAChBC,MAAMC,OAAO,CAACF,wBAAAA,KAAMG,KAAK,IAAKH,wBAAAA,KAAMG,KAAK,GAAgB,EAAE;AAE7D;;;;;;;;CAQC,GACD,OAAO,SAASC,oBACdJ,IAAuC,EACvCG,QAAoD,CAAC,CAAC;QAGpCH,WAGHA,aAQQK;IAZvB,IAAI,CAACL,QAAQA,KAAKM,WAAW,KAAKjC,gCAAgC,OAAO;IACz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AAWoF,EAAE,EAAE3G,SAAS4G,EAAE,EAAElF,UAAUmF,EAAE,EAAa,SAARC;;;;;;;;;QAEpH,MAAMrC,UAAU,aAAKqC,QAAWV;QAChC,IAAIrE,OAAOG,IAAI,CAACuC,SAASJ,MAAM,EAAEM,IAAI,CAAC9C,IAAI,GAAG4C;aACxC,OAAOE,IAAI,CAAC9C,IAAI;IACvB;IACA,OAAOmE,QAAQ;QAAEe,eAAepC;QAAMqB;QAAOC;IAAQ,IAAI;AAC3D;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASe,oBAAoBC,EAAW;IAC7C,MAAMC,QAAQ,IAAIrH;IAClB,MAAMsH,QAAQ,CAACrF,OAAgBsF;QAC7B,IAAI,CAACtF,SAAS,OAAOA,UAAU,YAAYsF,QAAQ,GAAG;QACtD,KAAK,MAAM,CAACvF,KAAK1B,MAAM,IAAI4B,OAAOC,OAAO,CAACF,OAAmC;YAC3E,KAAK,MAAMuF,SAASxF,IAAIyF,QAAQ,CAAC,qCAAsC;gBACrEJ,MAAM1E,GAAG,CAAC6E,KAAK,CAAC,EAAE;YACpB;YACAF,MAAMhH,OAAOiH,QAAQ;QACvB;IACF;IACAD,MAAMF,IAAI;IACV,OAAO;WAAIC;KAAM,CAACK,IAAI;AACxB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/forms/src/lib/model/form-field-elements.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * ONE ALL-IN-ONE FORM FIELD, REBUILT FROM MUI'S SEPARATE FORM ELEMENTS.\n *\n * Every piece of a field is its own Besigner element now (a Form Control\n * holding a Form Label and an Input, a Select of Select Options, a Radio Group\n * of Radios in Choice Labels, Checkboxes in Choice Labels, a Rating), so an\n * author selects and styles each piece with the ordinary Styles panel. The\n * all-in-one `formField` is still registered so a document nobody has migrated\n * keeps drawing, and this module is how each one is moved off it: the seeds,\n * the presets and `tools/scripts/backfill-formfield-elements.mjs` all build the\n * same tree from the same rules.\n *\n * What must survive the move, exactly:\n *\n * - **The field's id.** It stays on the Form Control wrapper, so a parent's\n * `nodes` list, a reveal target and every placement override keyed by it\n * still find the field. The wrapper takes the field's `sx` with it.\n * - **The name it submits under.** Contact-field mappings, dataset bindings\n * and the consent field all key on it, so it is copied verbatim.\n * - **Everything a placement overrode.** A placed form's `attrOverrides`\n * named the field's id and a prop of the all-in-one element; the slice is\n * re-keyed onto the piece that now owns that prop.\n *\n * It lives with the forms plugin, which owns the all-in-one element, rather\n * than in core: a form's vocabulary is the plugin's domain (docs/PACKAGES.md\n * rule 3).\n *\n * Pure and dependency-free (no imports at all) on purpose: the backfill is a\n * plain Node script that imports this file directly from its TypeScript\n * source, and an import here would drag a package graph into it.\n */\n\n/** A node as it is stored: a flat map entry with its children by id. */\nexport interface StoredFormNode {\n $id?: string\n componentId?: string\n pluginId?: string\n parentId?: string | null\n props?: Record<string, unknown>\n nodes?: string[]\n sx?: unknown\n [key: string]: unknown\n}\n\n/** The all-in-one element this module migrates away from. Persisted; never rename. */\nexport const LEGACY_FORM_FIELD_COMPONENT_ID = 'formField'\n\n/** The bundle that registers every element a field is rebuilt from. */\nexport const FORM_FIELD_ELEMENTS_PLUGIN_ID = 'mui'\n\n/**\n * MUI's form elements, by persisted component id — restated rather than\n * imported (see the module note; a plugin never imports another plugin).\n * `form-field-elements.spec.ts` holds this table equal to core's\n * `FORM_INPUT_ELEMENT_IDS` in `forms.ts`.\n */\nexport const FORM_FIELD_ELEMENT_IDS = {\n formControl: 'muiFormControl',\n formLabel: 'muiFormLabel',\n input: 'muiInput',\n select: 'muiSelect',\n selectOption: 'muiSelectOption',\n radioGroup: 'muiRadioGroup',\n radio: 'muiRadio',\n checkbox: 'muiCheckbox',\n choiceLabel: 'muiFormControlLabel',\n rating: 'muiRating',\n datePicker: 'muiDatePicker',\n timePicker: 'muiTimePicker',\n} as const\n\n/** The all-in-one element's types; anything else drew as a one-line text box. */\ntype LegacyFieldType =\n | 'text'\n | 'email'\n | 'textarea'\n | 'select'\n | 'radio'\n | 'checkbox'\n | 'rating'\n\nconst LEGACY_FIELD_TYPES = new Set<string>([\n 'text',\n 'email',\n 'textarea',\n 'select',\n 'radio',\n 'checkbox',\n 'rating',\n])\n\n/** The props the all-in-one element read; anything else rode onto its root. */\nconst LEGACY_FIELD_PROPS = new Set<string>([\n 'fieldName',\n 'datasetFieldId',\n 'label',\n 'placeholder',\n 'fieldType',\n 'options',\n 'required',\n])\n\n/**\n * A choice list as the all-in-one element split it: newline- or\n * comma-separated, trimmed, empties dropped (its own `parseFieldOptions`).\n */\nexport function parseLegacyFieldOptions(options: unknown): string[] {\n return (typeof options === 'string' ? options : '')\n .split(/[\\n,]/)\n .map((entry) => entry.trim())\n .filter(Boolean)\n}\n\n/** Which new node owns each prop the all-in-one element had. */\nexport interface FormFieldElementsLayout {\n /** The Form Control; the field's own id. */\n rootId: string\n /** The Form Label, when the field has one (not a lone checkbox). */\n labelId?: string\n /** Every node that submits the answer and carries `name`. */\n answerIds: string[]\n /** The nodes a placeholder belongs on (Input, Select). */\n placeholderIds: string[]\n /** The nodes `required` is enforced on. */\n requiredIds: string[]\n}\n\nexport interface FormFieldElements extends FormFieldElementsLayout {\n /** The wrapper and every new node under it, keyed by id. */\n nodes: Record<string, StoredFormNode>\n}\n\n/** Child ids of a stored node, in order. */\nconst childIds = (node: StoredFormNode | undefined): string[] =>\n Array.isArray(node?.nodes) ? (node?.nodes as string[]) : []\n\n/** An option that only says yes: on a lone box it is the answer, not the question. */\nconst BARE_AFFIRMATIVE = /^(yes|y|ok|okay|true|on|agree|i agree)[.!]?$/i\nfunction isBareAffirmative(option: string): boolean {\n return BARE_AFFIRMATIVE.test(option.trim())\n}\n\n/**\n * The all-in-one `formField` node `node`, rebuilt as MUI's separate form\n * elements — or `null` when it is not one.\n *\n * `nodes` is the tree it sits in, read only so a new id never collides with\n * one already there. New ids are derived from the field's own\n * (`<id>-label`, `<id>-input`, `<id>-opt-0`, `<id>-opt-0-input`), so a\n * second run over the same field mints the same tree.\n */\nexport function formFieldToElements(\n node: StoredFormNode | undefined | null,\n nodes: Record<string, StoredFormNode | undefined> = {},\n): FormFieldElements | null {\n if (!node || node.componentId !== LEGACY_FORM_FIELD_COMPONENT_ID) return null\n const id = String(node.$id ?? '')\n if (!id) return null\n\n const props = (node.props ?? {}) as Record<string, unknown>\n const rawName = props['fieldName']\n // Exactly what the element submitted under: `fieldName || 'field'`.\n const name = rawName === undefined || rawName === null || rawName === ''\n ? 'field'\n : String(rawName)\n const label =\n String(props['label'] || '') || String(rawName || '') || 'Field'\n const rawType = String(props['fieldType'] ?? 'text')\n const fieldType = (\n LEGACY_FIELD_TYPES.has(rawType) ? rawType : 'text'\n ) as LegacyFieldType\n const placeholder =\n typeof props['placeholder'] === 'string' && props['placeholder'].trim()\n ? (props['placeholder'] as string)\n : undefined\n const required = Boolean(props['required'])\n const datasetFieldId =\n typeof props['datasetFieldId'] === 'string' && props['datasetFieldId'].trim()\n ? (props['datasetFieldId'] as string)\n : undefined\n const options = parseLegacyFieldOptions(props['options'])\n\n // Whatever else the author's props held rode onto the element's root, so\n // it rides onto the wrapper.\n const rest: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(props)) {\n if (!LEGACY_FIELD_PROPS.has(key)) rest[key] = value\n }\n\n const taken = new Set<string>(Object.keys(nodes))\n taken.delete(id)\n const mint = (base: string): string => {\n let candidate = base\n for (let n = 2; taken.has(candidate); n += 1) candidate = `${base}-${n}`\n taken.add(candidate)\n return candidate\n }\n\n const out: Record<string, StoredFormNode> = {}\n const typed = node.type !== undefined ? { type: node.type } : {}\n const add = (\n nodeId: string,\n parentId: string,\n componentId: string,\n nodeProps: Record<string, unknown>,\n ): string => {\n out[nodeId] = {\n $id: nodeId,\n ...typed,\n componentId,\n pluginId: FORM_FIELD_ELEMENTS_PLUGIN_ID,\n parentId,\n props: nodeProps,\n }\n const parent = out[parentId]\n if (parent) parent.nodes = [...childIds(parent), nodeId]\n return nodeId\n }\n const mapping = datasetFieldId ? { datasetFieldId } : {}\n const req = required ? { required: true } : {}\n\n const fullWidth =\n fieldType === 'text' ||\n fieldType === 'email' ||\n fieldType === 'textarea' ||\n fieldType === 'select'\n const { nodes: _ownChildren, props: _props, ...shell } = node\n out[id] = {\n ...shell,\n componentId: FORM_FIELD_ELEMENT_IDS.formControl,\n pluginId: FORM_FIELD_ELEMENTS_PLUGIN_ID,\n props: {\n ...rest,\n ...(fullWidth ? { fullWidth: true } : {}),\n ...req,\n },\n nodes: [],\n }\n\n const layout: FormFieldElementsLayout = {\n rootId: id,\n answerIds: [],\n placeholderIds: [],\n requiredIds: [],\n }\n const addLabel = () => {\n layout.labelId = add(mint(`${id}-label`), id, FORM_FIELD_ELEMENT_IDS.formLabel, {\n children: label,\n })\n }\n\n switch (fieldType) {\n case 'select': {\n addLabel()\n const select = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.select, {\n name,\n ...(placeholder ? { placeholder } : {}),\n ...req,\n fullWidth: true,\n ...mapping,\n })\n options.forEach((option, index) => {\n add(mint(`${id}-opt-${index}`), select, FORM_FIELD_ELEMENT_IDS.selectOption, {\n children: option,\n })\n })\n layout.answerIds.push(select)\n layout.placeholderIds.push(select)\n layout.requiredIds.push(select)\n break\n }\n case 'radio': {\n addLabel()\n const group = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.radioGroup, {\n name,\n ...mapping,\n })\n options.forEach((option, index) => {\n const choice = add(\n mint(`${id}-opt-${index}`),\n group,\n FORM_FIELD_ELEMENT_IDS.choiceLabel,\n { label: option },\n )\n const radio = add(mint(`${id}-opt-${index}-input`), choice, FORM_FIELD_ELEMENT_IDS.radio, {\n value: option,\n ...req,\n })\n layout.requiredIds.push(radio)\n })\n layout.answerIds.push(group)\n break\n }\n case 'checkbox': {\n // A lone box is its own question: the words beside it say it all. A\n // group of boxes keeps the question above them.\n if (options.length !== 1) addLabel()\n // A lone box whose one option is only a yes-word (\"Yes\") was asked by\n // its field label (\"Email me news and updates\"): those are the words a\n // visitor needs beside the box, where \"Yes\" alone says nothing. It\n // still posts the option, so a consent box reads as ticked as before.\n const loneWords =\n options.length === 1 && label && isBareAffirmative(options[0] as string)\n ? label\n : undefined\n options.forEach((option, index) => {\n const choice = add(\n mint(`${id}-opt-${index}`),\n id,\n FORM_FIELD_ELEMENT_IDS.choiceLabel,\n { label: loneWords ?? option },\n )\n // `value` is the option text, as the all-in-one element posted it —\n // which is also what makes a single-option marketing consent box\n // read as ticked (`isConsentCheckboxTicked`). `required` only on a\n // lone box: on a group it meant \"at least one\", which a box of its\n // own cannot say.\n const box = add(mint(`${id}-opt-${index}-input`), choice, FORM_FIELD_ELEMENT_IDS.checkbox, {\n name,\n value: option,\n ...(options.length === 1 ? req : {}),\n ...mapping,\n })\n layout.answerIds.push(box)\n if (options.length === 1) layout.requiredIds.push(box)\n })\n break\n }\n case 'rating': {\n addLabel()\n const rating = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.rating, {\n name,\n ...mapping,\n })\n layout.answerIds.push(rating)\n break\n }\n default: {\n addLabel()\n const input = add(mint(`${id}-input`), id, FORM_FIELD_ELEMENT_IDS.input, {\n name,\n type: fieldType === 'email' ? 'email' : 'text',\n ...(fieldType === 'textarea' ? { multiline: true, minRows: 3 } : {}),\n ...(placeholder ? { placeholder } : {}),\n ...req,\n fullWidth: true,\n ...mapping,\n })\n layout.answerIds.push(input)\n layout.placeholderIds.push(input)\n layout.requiredIds.push(input)\n }\n }\n\n // A self-closing field never had children, but one that somehow did keeps\n // them rather than orphaning them.\n const wrapper = out[id] as StoredFormNode\n wrapper.nodes = [...childIds(wrapper), ...childIds(node)]\n return { ...layout, nodes: out }\n}\n\n/**\n * Every all-in-one field in a tree, rebuilt — or `null` when the tree holds\n * none. The tree is not mutated; the result is a new map with each field\n * replaced in place (same id) and its new pieces added.\n */\nexport function migrateFormFieldNodes(\n nodes: Record<string, StoredFormNode | undefined> | null | undefined,\n): { nodes: Record<string, StoredFormNode>; converted: string[] } | null {\n if (!nodes || typeof nodes !== 'object') return null\n const next: Record<string, StoredFormNode> = { ...(nodes as Record<string, StoredFormNode>) }\n const converted: string[] = []\n for (const [key, node] of Object.entries(nodes)) {\n if (!node || node.componentId !== LEGACY_FORM_FIELD_COMPONENT_ID) continue\n const elements = formFieldToElements({ ...node, $id: node.$id ?? key }, next)\n if (!elements) continue\n Object.assign(next, elements.nodes)\n converted.push(key)\n }\n return converted.length ? { nodes: next, converted } : null\n}\n\n/**\n * Which piece owns each prop of the field at `id` in a DEFINITION tree,\n * whether that tree still holds the all-in-one element or already holds its\n * replacement — so re-keying a placement works before and after the design\n * itself was migrated, and a re-run never double-moves anything.\n */\nexport function formFieldLayoutIn(\n definition: Record<string, StoredFormNode | undefined>,\n id: string,\n): FormFieldElementsLayout | null {\n const node = definition[id]\n if (!node) return null\n if (node.componentId === LEGACY_FORM_FIELD_COMPONENT_ID) {\n const elements = formFieldToElements({ ...node, $id: node.$id ?? id }, definition)\n if (!elements) return null\n const { nodes: _nodes, ...layout } = elements\n return layout\n }\n if (node.componentId !== FORM_FIELD_ELEMENT_IDS.formControl) return null\n\n const layout: FormFieldElementsLayout = {\n rootId: id,\n answerIds: [],\n placeholderIds: [],\n requiredIds: [],\n }\n const checkboxes: string[] = []\n const stack = [...childIds(node)].reverse()\n const seen = new Set<string>([id])\n while (stack.length) {\n const childId = stack.pop() as string\n if (seen.has(childId)) continue\n seen.add(childId)\n const child = definition[childId]\n if (!child) continue\n switch (child.componentId) {\n case FORM_FIELD_ELEMENT_IDS.formLabel:\n if (!layout.labelId && child.parentId === id) layout.labelId = childId\n break\n case FORM_FIELD_ELEMENT_IDS.input:\n case FORM_FIELD_ELEMENT_IDS.select:\n layout.answerIds.push(childId)\n layout.placeholderIds.push(childId)\n layout.requiredIds.push(childId)\n break\n case FORM_FIELD_ELEMENT_IDS.radioGroup:\n case FORM_FIELD_ELEMENT_IDS.rating:\n layout.answerIds.push(childId)\n break\n case FORM_FIELD_ELEMENT_IDS.radio:\n layout.requiredIds.push(childId)\n break\n case FORM_FIELD_ELEMENT_IDS.checkbox:\n layout.answerIds.push(childId)\n checkboxes.push(childId)\n break\n default:\n break\n }\n const children = childIds(child)\n for (let index = children.length - 1; index >= 0; index -= 1) {\n stack.push(children[index] as string)\n }\n }\n if (checkboxes.length === 1) layout.requiredIds.push(checkboxes[0] as string)\n return layout\n}\n\n/** A placement override that had nowhere to go, reported rather than kept. */\nexport interface DroppedFormFieldOverride {\n key: string\n prop: string\n}\n\n/**\n * A placement's `attrOverrides` re-keyed for MUI's separate form elements, or\n * `null` when nothing in it named an all-in-one field's props.\n *\n * `overrides` is keyed by DEFINITION node ids (a placed form's design, a\n * reusable component's definition). A slice keyed by a field's id moves:\n * `label` onto the Form Label (as its text), `placeholder` onto the Input or\n * Select, `fieldName` onto every answer element (as `name`), `required` onto\n * the elements that enforce it and the wrapper, `datasetFieldId` onto the\n * answer elements. Anything else in the slice (`sx` among it) stays on the\n * field's id, which is the wrapper. `fieldType` and `options` re-shape the\n * field itself and have no single new home; they are dropped and returned so\n * the caller can report them.\n */\nexport function rekeyFormFieldOverrides(\n overrides: unknown,\n definition: Record<string, StoredFormNode | undefined> | null | undefined,\n): {\n attrOverrides: Record<string, Record<string, unknown>>\n moved: number\n dropped: DroppedFormFieldOverride[]\n} | null {\n if (!overrides || typeof overrides !== 'object' || Array.isArray(overrides)) return null\n if (!definition) return null\n const source = overrides as Record<string, unknown>\n const next: Record<string, Record<string, unknown>> = {}\n for (const [key, slice] of Object.entries(source)) {\n if (slice && typeof slice === 'object' && !Array.isArray(slice)) {\n next[key] = { ...(slice as Record<string, unknown>) }\n }\n }\n const put = (targetId: string, prop: string, value: unknown) => {\n next[targetId] = { ...(next[targetId] ?? {}), [prop]: value }\n }\n let moved = 0\n const dropped: DroppedFormFieldOverride[] = []\n for (const [key, slice] of Object.entries(source)) {\n if (!slice || typeof slice !== 'object' || Array.isArray(slice)) continue\n const own = slice as Record<string, unknown>\n if (!Object.keys(own).some((prop) => LEGACY_FIELD_PROPS.has(prop))) continue\n const layout = formFieldLayoutIn(definition, key)\n if (!layout) continue\n const kept: Record<string, unknown> = {}\n for (const [prop, value] of Object.entries(own)) {\n switch (prop) {\n case 'label':\n if (layout.labelId) put(layout.labelId, 'children', value)\n else dropped.push({ key, prop })\n break\n case 'placeholder':\n if (layout.placeholderIds.length) {\n for (const target of layout.placeholderIds) put(target, 'placeholder', value)\n } else dropped.push({ key, prop })\n break\n case 'fieldName':\n if (layout.answerIds.length) {\n for (const target of layout.answerIds) put(target, 'name', value)\n } else dropped.push({ key, prop })\n break\n case 'datasetFieldId':\n if (layout.answerIds.length) {\n for (const target of layout.answerIds) put(target, 'datasetFieldId', value)\n } else dropped.push({ key, prop })\n break\n case 'required':\n kept['required'] = value\n for (const target of layout.requiredIds) put(target, 'required', value)\n break\n case 'fieldType':\n case 'options':\n dropped.push({ key, prop })\n break\n default:\n kept[prop] = value\n }\n }\n moved += 1\n // The wrapper's slice is rebuilt from what stayed, merged over anything\n // a re-key of ANOTHER field put there (none can — ids are per field —\n // but the merge keeps the rule obvious).\n const { label: _l, placeholder: _p, fieldName: _f, datasetFieldId: _d, fieldType: _t, options: _o, required: _r, ...others } =\n next[key] ?? {}\n const wrapper = { ...others, ...kept }\n if (Object.keys(wrapper).length) next[key] = wrapper\n else delete next[key]\n }\n return moved ? { attrOverrides: next, moved, dropped } : null\n}\n\n/**\n * The MUI class names a stored `sx` (or a style override slice) selects, such\n * as `& .MuiInputLabel-root` or `& .MuiOutlinedInput-notchedOutline`.\n *\n * The all-in-one element drew a TextField, so an author's styles could reach\n * into its inner classes. After the move a field is separate elements whose\n * own classes differ (`MuiFormLabel`, not `MuiInputLabel`), so such a\n * selector may match nothing; the backfill lists every one for a person to\n * restate on the right element.\n */\nexport function muiClassSelectorsIn(sx: unknown): string[] {\n const found = new Set<string>()\n const visit = (value: unknown, depth: number) => {\n if (!value || typeof value !== 'object' || depth > 8) return\n for (const [key, entry] of Object.entries(value as Record<string, unknown>)) {\n for (const match of key.matchAll(/Mui[A-Z][A-Za-z]*(?:-[A-Za-z]+)?/g)) {\n found.add(match[0])\n }\n visit(entry, depth + 1)\n }\n }\n visit(sx, 0)\n return [...found].sort()\n}\n"],"names":["LEGACY_FORM_FIELD_COMPONENT_ID","FORM_FIELD_ELEMENTS_PLUGIN_ID","FORM_FIELD_ELEMENT_IDS","formControl","formLabel","input","select","selectOption","radioGroup","radio","checkbox","choiceLabel","rating","datePicker","timePicker","LEGACY_FIELD_TYPES","Set","LEGACY_FIELD_PROPS","parseLegacyFieldOptions","options","split","map","entry","trim","filter","Boolean","childIds","node","Array","isArray","nodes","BARE_AFFIRMATIVE","isBareAffirmative","option","test","formFieldToElements","props","componentId","id","String","$id","rawName","name","undefined","label","rawType","fieldType","has","placeholder","required","datasetFieldId","rest","key","value","Object","entries","taken","keys","delete","mint","base","candidate","n","add","out","typed","type","nodeId","parentId","nodeProps","pluginId","parent","mapping","req","fullWidth","_ownChildren","_props","shell","layout","rootId","answerIds","placeholderIds","requiredIds","addLabel","labelId","children","forEach","index","push","group","choice","length","loneWords","box","multiline","minRows","wrapper","migrateFormFieldNodes","next","converted","elements","assign","formFieldLayoutIn","definition","_nodes","checkboxes","stack","reverse","seen","childId","pop","child","rekeyFormFieldOverrides","overrides","source","slice","put","targetId","prop","moved","dropped","own","some","kept","target","_l","_p","fieldName","_f","_d","_t","_o","_r","others","attrOverrides","muiClassSelectorsIn","sx","found","visit","depth","match","matchAll","sort"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;;;;;;;;;;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OAAOiF,EAAE,EAAE7E,aAAa8E,EAAE,EAAEC,WAAWC,EAAE,EAAE9E,gBAAgB+E,EAAE,EAAEnF,WAAWoF,EAAE,EAAE/G,SAASgH,EAAE,EAAElF,UAAUmF,EAAE,EAAa,SAARC;;;;;;;;;QAEpH,MAAMrC,UAAU,aAAKqC,QAAWV;QAChC,IAAIrE,OAAOG,IAAI,CAACuC,SAASL,MAAM,EAAEO,IAAI,CAAC9C,IAAI,GAAG4C;aACxC,OAAOE,IAAI,CAAC9C,IAAI;IACvB;IACA,OAAOmE,QAAQ;QAAEe,eAAepC;QAAMqB;QAAOC;IAAQ,IAAI;AAC3D;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASe,oBAAoBC,EAAW;IAC7C,MAAMC,QAAQ,IAAIzH;IAClB,MAAM0H,QAAQ,CAACrF,OAAgBsF;QAC7B,IAAI,CAACtF,SAAS,OAAOA,UAAU,YAAYsF,QAAQ,GAAG;QACtD,KAAK,MAAM,CAACvF,KAAK9B,MAAM,IAAIgC,OAAOC,OAAO,CAACF,OAAmC;YAC3E,KAAK,MAAMuF,SAASxF,IAAIyF,QAAQ,CAAC,qCAAsC;gBACrEJ,MAAM1E,GAAG,CAAC6E,KAAK,CAAC,EAAE;YACpB;YACAF,MAAMpH,OAAOqH,QAAQ;QACvB;IACF;IACAD,MAAMF,IAAI;IACV,OAAO;WAAIC;KAAM,CAACK,IAAI;AACxB"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
|
-
*/ import { booleanField as bool, objectKindField as OBJECT_FIELD, openObjectField as objectOf, queryParam as q, RECORD_STAMPS as STAMPS, stringField as str } from "@aglyn/tenant-data-admin/server/api-v1-description";
|
|
16
|
+
*/ import { booleanField as bool, objectKindField as OBJECT_FIELD, openObjectField as objectOf, queryParam as q, RECORD_STAMPS as STAMPS, stringField as str, SITE_ID_PATH_PARAM } from "@aglyn/tenant-data-admin/server/api-v1-description";
|
|
17
17
|
/**
|
|
18
18
|
* `/v1/sites/{siteId}/form-submissions` as the customer API's OpenAPI
|
|
19
19
|
* document describes it — what the console's builder turns into paths, a tag
|
|
@@ -69,10 +69,7 @@
|
|
|
69
69
|
})
|
|
70
70
|
],
|
|
71
71
|
pathParams: [
|
|
72
|
-
|
|
73
|
-
name: 'siteId',
|
|
74
|
-
description: 'Site id.'
|
|
75
|
-
}
|
|
72
|
+
SITE_ID_PATH_PARAM
|
|
76
73
|
]
|
|
77
74
|
},
|
|
78
75
|
{
|
|
@@ -82,10 +79,7 @@
|
|
|
82
79
|
summary: 'Retrieve a submission',
|
|
83
80
|
returns: 'FormSubmission',
|
|
84
81
|
pathParams: [
|
|
85
|
-
|
|
86
|
-
name: 'siteId',
|
|
87
|
-
description: 'Site id.'
|
|
88
|
-
},
|
|
82
|
+
SITE_ID_PATH_PARAM,
|
|
89
83
|
{
|
|
90
84
|
name: 'submissionId',
|
|
91
85
|
description: 'Submission id.'
|
|
@@ -100,10 +94,7 @@
|
|
|
100
94
|
accepts: 'FormSubmissionWrite',
|
|
101
95
|
returns: 'FormSubmission',
|
|
102
96
|
pathParams: [
|
|
103
|
-
|
|
104
|
-
name: 'siteId',
|
|
105
|
-
description: 'Site id.'
|
|
106
|
-
},
|
|
97
|
+
SITE_ID_PATH_PARAM,
|
|
107
98
|
{
|
|
108
99
|
name: 'submissionId',
|
|
109
100
|
description: 'Submission id.'
|
|
@@ -117,10 +108,7 @@
|
|
|
117
108
|
summary: 'Delete a submission',
|
|
118
109
|
returns: 'Deleted',
|
|
119
110
|
pathParams: [
|
|
120
|
-
|
|
121
|
-
name: 'siteId',
|
|
122
|
-
description: 'Site id.'
|
|
123
|
-
},
|
|
111
|
+
SITE_ID_PATH_PARAM,
|
|
124
112
|
{
|
|
125
113
|
name: 'submissionId',
|
|
126
114
|
description: 'Submission id.'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/plugins/forms/src/lib/server/api-v1/openapi.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type ApiV1ResourceDescription,\n booleanField as bool,\n objectKindField as OBJECT_FIELD,\n openObjectField as objectOf,\n queryParam as q,\n RECORD_STAMPS as STAMPS,\n stringField as str,\n} from '@aglyn/tenant-data-admin/server/api-v1-description'\n\n/**\n * `/v1/sites/{siteId}/form-submissions` as the customer API's OpenAPI\n * document describes it — what the console's builder turns into paths, a tag\n * and schemas, and the MCP tools derive from. Transcribed unchanged from the\n * builder's own list when the resource moved here (AGL-3080);\n * `api-v1-openapi.spec.ts` holds the document to every endpoint the\n * documentation promises.\n */\nexport const FORM_SUBMISSIONS_API_V1_DESCRIPTION: ApiV1ResourceDescription = {\n tag: 'Form submissions',\n description: 'What visitors sent through a site’s forms.',\n schemaName: 'FormSubmission',\n required: ['id', 'object', 'form_id', 'fields'],\n writable: ['read'],\n writeRequired: ['read'],\n fields: {\n id: str('Submission id.'),\n object: OBJECT_FIELD('form_submission'),\n form_id: str('Form id.'),\n form: str('Form name.'),\n path: str('Page path the form was submitted from.'),\n fields: objectOf('The submitted values, keyed by field name.'),\n read: bool('Whether the submission has been marked read.'),\n routing: objectOf('Where the submission was routed.'),\n created: STAMPS.created,\n },\n ops: [\n { path: '/v1/sites/{siteId}/form-submissions', method: 'get', operationId: 'listFormSubmissions', summary: 'List submissions', list: true, returns: 'FormSubmission', description: 'Combining `form`/`formId` with `read` narrows on the form and checks `read` on the page, so pages can come back short.', filters: [q('form', 'Form name.'), q('formId', 'Form id.'), q('read', 'Either `true` or `false`. Anything else is a 400.', { type: 'string', enum: ['true', 'false'] })], pathParams: [
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/forms/src/lib/server/api-v1/openapi.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type ApiV1ResourceDescription,\n booleanField as bool,\n objectKindField as OBJECT_FIELD,\n openObjectField as objectOf,\n queryParam as q,\n RECORD_STAMPS as STAMPS,\n stringField as str,\n SITE_ID_PATH_PARAM,\n} from '@aglyn/tenant-data-admin/server/api-v1-description'\n\n/**\n * `/v1/sites/{siteId}/form-submissions` as the customer API's OpenAPI\n * document describes it — what the console's builder turns into paths, a tag\n * and schemas, and the MCP tools derive from. Transcribed unchanged from the\n * builder's own list when the resource moved here (AGL-3080);\n * `api-v1-openapi.spec.ts` holds the document to every endpoint the\n * documentation promises.\n */\nexport const FORM_SUBMISSIONS_API_V1_DESCRIPTION: ApiV1ResourceDescription = {\n tag: 'Form submissions',\n description: 'What visitors sent through a site’s forms.',\n schemaName: 'FormSubmission',\n required: ['id', 'object', 'form_id', 'fields'],\n writable: ['read'],\n writeRequired: ['read'],\n fields: {\n id: str('Submission id.'),\n object: OBJECT_FIELD('form_submission'),\n form_id: str('Form id.'),\n form: str('Form name.'),\n path: str('Page path the form was submitted from.'),\n fields: objectOf('The submitted values, keyed by field name.'),\n read: bool('Whether the submission has been marked read.'),\n routing: objectOf('Where the submission was routed.'),\n created: STAMPS.created,\n },\n ops: [\n { path: '/v1/sites/{siteId}/form-submissions', method: 'get', operationId: 'listFormSubmissions', summary: 'List submissions', list: true, returns: 'FormSubmission', description: 'Combining `form`/`formId` with `read` narrows on the form and checks `read` on the page, so pages can come back short.', filters: [q('form', 'Form name.'), q('formId', 'Form id.'), q('read', 'Either `true` or `false`. Anything else is a 400.', { type: 'string', enum: ['true', 'false'] })], pathParams: [SITE_ID_PATH_PARAM] },\n { path: '/v1/sites/{siteId}/form-submissions/{submissionId}', method: 'get', operationId: 'getFormSubmission', summary: 'Retrieve a submission', returns: 'FormSubmission', pathParams: [SITE_ID_PATH_PARAM, { name: 'submissionId', description: 'Submission id.' }] },\n { path: '/v1/sites/{siteId}/form-submissions/{submissionId}', method: 'patch', operationId: 'updateFormSubmission', summary: 'Mark a submission read', accepts: 'FormSubmissionWrite', returns: 'FormSubmission', pathParams: [SITE_ID_PATH_PARAM, { name: 'submissionId', description: 'Submission id.' }] },\n { path: '/v1/sites/{siteId}/form-submissions/{submissionId}', method: 'delete', operationId: 'deleteFormSubmission', summary: 'Delete a submission', returns: 'Deleted', pathParams: [SITE_ID_PATH_PARAM, { name: 'submissionId', description: 'Submission id.' }] },\n ],\n}\n"],"names":["booleanField","bool","objectKindField","OBJECT_FIELD","openObjectField","objectOf","queryParam","q","RECORD_STAMPS","STAMPS","stringField","str","SITE_ID_PATH_PARAM","FORM_SUBMISSIONS_API_V1_DESCRIPTION","tag","description","schemaName","required","writable","writeRequired","fields","id","object","form_id","form","path","read","routing","created","ops","method","operationId","summary","list","returns","filters","type","enum","pathParams","name","accepts"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAEEA,gBAAgBC,IAAI,EACpBC,mBAAmBC,YAAY,EAC/BC,mBAAmBC,QAAQ,EAC3BC,cAAcC,CAAC,EACfC,iBAAiBC,MAAM,EACvBC,eAAeC,GAAG,EAClBC,kBAAkB,QACb,qDAAoD;AAE3D;;;;;;;CAOC,GACD,OAAO,MAAMC,sCAAgE;IAC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