@vectoriox/iox-builder 4.18.2 → 4.19.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.
|
@@ -872,6 +872,13 @@ var PanelEventTypes;
|
|
|
872
872
|
* would (`string` component type, or a block / symbol object). The builder resolves WHERE from
|
|
873
873
|
* the current selection — see `resolveInsertTarget`. */
|
|
874
874
|
PanelEventTypes["INSERT_COMPONENT"] = "insertcomponent";
|
|
875
|
+
/** A panel wants to select a NODE it already has a reference to (e.g. the Form's nested field
|
|
876
|
+
* list). Carries `{ node }`. `OverlayService.setSelect()` alone only updates the overlay's own
|
|
877
|
+
* visual state — `selectedItem`/`selectedPath` (breadcrumb) and every other panel's idea of
|
|
878
|
+
* "what's selected" stay stale unless the SAME `_emitElementSelect` a real canvas click goes
|
|
879
|
+
* through also runs. This event is that path for code outside `BuilderComponent` itself,
|
|
880
|
+
* mirroring what `onTreeNodeSelect`/`onCrumbSelect` already do internally. */
|
|
881
|
+
PanelEventTypes["SELECT_NODE"] = "selectnode";
|
|
875
882
|
})(PanelEventTypes || (PanelEventTypes = {}));
|
|
876
883
|
class PanelEventService {
|
|
877
884
|
constructor() {
|
|
@@ -7077,6 +7084,19 @@ class BuilderComponent {
|
|
|
7077
7084
|
this.insertFromPanel(panelEvent.data);
|
|
7078
7085
|
return;
|
|
7079
7086
|
}
|
|
7087
|
+
// A panel (e.g. the Form's nested field list) wants to select a node it already holds a
|
|
7088
|
+
// reference to — same path onTreeNodeSelect/onCrumbSelect use, so selectedItem/selectedPath
|
|
7089
|
+
// and every panel stay in sync, not just the overlay's own visual selection box.
|
|
7090
|
+
if (panelEvent.type === PanelEventTypes.SELECT_NODE) {
|
|
7091
|
+
const node = panelEvent.data?.node;
|
|
7092
|
+
const ref = node ? this.overlayService.getNodeRef(node) : undefined;
|
|
7093
|
+
if (node && ref) {
|
|
7094
|
+
this.selectedItem = node;
|
|
7095
|
+
this.overlayService.setSelect(ref.element, node.type, this.activeMode, node, ref.componentRef);
|
|
7096
|
+
this._emitElementSelect(node, ref.componentRef);
|
|
7097
|
+
}
|
|
7098
|
+
return;
|
|
7099
|
+
}
|
|
7080
7100
|
// Every style or structural edit — including a breakpoint override — emits LAYOUT_CHANGED.
|
|
7081
7101
|
if (panelEvent.type === PanelEventTypes.LAYOUT_CHANGED) {
|
|
7082
7102
|
this.refreshBreakpointCounts();
|
|
@@ -9752,7 +9772,7 @@ class FormComponentConfig extends ComponentConfig {
|
|
|
9752
9772
|
// Stable identity the submit endpoint resolves the saved spec by. Generated on create;
|
|
9753
9773
|
// shown read-only-ish so an author can copy it into a webhook consumer.
|
|
9754
9774
|
new TraitConfig('formId', 'Form ID', TraitInputType.Text, undefined, ''),
|
|
9755
|
-
new TraitConfig('feedback', '
|
|
9775
|
+
new TraitConfig('feedback', 'Tell them about mistakes', TraitInputType.Select, [
|
|
9756
9776
|
{ label: 'Smart — on submit, then live once touched', value: 'smart' },
|
|
9757
9777
|
{ label: 'On submit only', value: 'submit' },
|
|
9758
9778
|
{ label: 'As you type', value: 'live' },
|
|
@@ -9762,7 +9782,7 @@ class FormComponentConfig extends ComponentConfig {
|
|
|
9762
9782
|
// On by default and invisible to the visitor (decision D12).
|
|
9763
9783
|
new TraitConfig('honeypot', 'Honeypot field', TraitInputType.Checkbox, undefined, true),
|
|
9764
9784
|
new TraitConfig('minFillMs', 'Minimum fill time (ms)', TraitInputType.Number, undefined, 1200),
|
|
9765
|
-
new TraitConfig('__afterSubmitLabel', '
|
|
9785
|
+
new TraitConfig('__afterSubmitLabel', 'Where the answers go', TraitInputType.SectionLabel),
|
|
9766
9786
|
// The ordered destination list. `store` is always first and cannot be removed — it is
|
|
9767
9787
|
// the safety net the whole store-first design rests on.
|
|
9768
9788
|
new TraitConfig('actions', 'Destinations', TraitInputType.ActionList, undefined, [{ type: 'store' }]),
|
|
@@ -9800,7 +9820,7 @@ class FieldComponentConfig extends ComponentConfig {
|
|
|
9800
9820
|
new TraitConfig('label', 'Label', TraitInputType.Text, undefined, 'Label'),
|
|
9801
9821
|
// Choosing the control also chooses the validation — an Email field validates email
|
|
9802
9822
|
// with nothing configured.
|
|
9803
|
-
new TraitConfig('control', '
|
|
9823
|
+
new TraitConfig('control', 'Kind of answer', TraitInputType.Select, [
|
|
9804
9824
|
{ label: 'Text', value: 'text' },
|
|
9805
9825
|
{ label: 'Email', value: 'email' },
|
|
9806
9826
|
{ label: 'Phone', value: 'tel' },
|
|
@@ -9820,7 +9840,7 @@ class FieldComponentConfig extends ComponentConfig {
|
|
|
9820
9840
|
// enforcement nor the file. See forms-and-inputs-plan.md → Remaining work P0/1.
|
|
9821
9841
|
{ label: 'Hidden', value: 'hidden' },
|
|
9822
9842
|
], 'text'),
|
|
9823
|
-
new TraitConfig('placeholder', '
|
|
9843
|
+
new TraitConfig('placeholder', 'Hint inside the box', TraitInputType.Text, undefined, '', false, { trait: 'control', values: ['text', 'email', 'tel', 'url', 'number', 'password', 'textarea', 'select'] }),
|
|
9824
9844
|
new TraitConfig('help', 'Help text', TraitInputType.Text, undefined, ''),
|
|
9825
9845
|
new TraitConfig('rows', 'Rows', TraitInputType.Number, undefined, 4, false, { trait: 'control', values: 'textarea' }),
|
|
9826
9846
|
new TraitConfig('labelHidden', 'Hide label (screen readers still read it)', TraitInputType.Checkbox, undefined, false),
|
|
@@ -9831,8 +9851,8 @@ class FieldComponentConfig extends ComponentConfig {
|
|
|
9831
9851
|
// One per line, `value|Label` or just the label. A richer editor arrives with bound
|
|
9832
9852
|
// options in Phase 2; this keeps v1 to one control instead of a new trait type.
|
|
9833
9853
|
new TraitConfig('optionsText', 'Choices (one per line)', TraitInputType.Textarea, undefined, '', false, { trait: 'control', values: ['select', 'radio'] }),
|
|
9834
|
-
new TraitConfig('__validationLabel', '
|
|
9835
|
-
new TraitConfig('required', '
|
|
9854
|
+
new TraitConfig('__validationLabel', 'What this field demands', TraitInputType.SectionLabel),
|
|
9855
|
+
new TraitConfig('required', 'They must fill it in', TraitInputType.Checkbox, undefined, false),
|
|
9836
9856
|
// The additive rule list (minLength, pattern, matches, …). Unused rules are invisible
|
|
9837
9857
|
// rather than a wall of empty controls — the Effects-group pattern.
|
|
9838
9858
|
new TraitConfig('rules', 'Rules', TraitInputType.RuleList, undefined, []),
|