@aglyn/besigner-ui 1.23.1 → 1.24.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 +17 -17
- package/src/lib/components/element-props-form.component.js +28 -5
- package/src/lib/components/element-props-form.component.js.map +1 -1
- package/src/lib/components/property-binding-field.component.d.ts +8 -0
- package/src/lib/components/property-binding-field.component.js +25 -9
- package/src/lib/components/property-binding-field.component.js.map +1 -1
- package/src/lib/hooks/use-insert-token-options.d.ts +22 -0
- package/src/lib/hooks/use-insert-token-options.js +24 -3
- package/src/lib/hooks/use-insert-token-options.js.map +1 -1
- package/src/lib/utils/token-segments.d.ts +1 -1
- package/src/lib/utils/token-segments.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/besigner-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.
|
|
30
|
-
"@aglyn/aglyn-node-renderer": "1.
|
|
31
|
-
"@aglyn/besigner": "1.
|
|
32
|
-
"@aglyn/shared-data-enums": "1.
|
|
33
|
-
"@aglyn/shared-data-mdi": "1.
|
|
34
|
-
"@aglyn/shared-data-types": "1.
|
|
35
|
-
"@aglyn/shared-svg-icons": "1.
|
|
36
|
-
"@aglyn/shared-ui-json-editor": "1.
|
|
37
|
-
"@aglyn/shared-ui-jsx": "1.
|
|
38
|
-
"@aglyn/shared-ui-jsx-forms": "1.
|
|
39
|
-
"@aglyn/shared-ui-snackstack": "1.
|
|
40
|
-
"@aglyn/shared-ui-theme": "1.
|
|
41
|
-
"@aglyn/shared-util-dom": "1.
|
|
42
|
-
"@aglyn/shared-util-tools": "1.
|
|
43
|
-
"@aglyn/shared-util-vendor": "1.
|
|
28
|
+
"@aglyn/aglyn": "1.24.0",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.24.0",
|
|
30
|
+
"@aglyn/aglyn-node-renderer": "1.24.0",
|
|
31
|
+
"@aglyn/besigner": "1.24.0",
|
|
32
|
+
"@aglyn/shared-data-enums": "1.24.0",
|
|
33
|
+
"@aglyn/shared-data-mdi": "1.24.0",
|
|
34
|
+
"@aglyn/shared-data-types": "1.24.0",
|
|
35
|
+
"@aglyn/shared-svg-icons": "1.24.0",
|
|
36
|
+
"@aglyn/shared-ui-json-editor": "1.24.0",
|
|
37
|
+
"@aglyn/shared-ui-jsx": "1.24.0",
|
|
38
|
+
"@aglyn/shared-ui-jsx-forms": "1.24.0",
|
|
39
|
+
"@aglyn/shared-ui-snackstack": "1.24.0",
|
|
40
|
+
"@aglyn/shared-ui-theme": "1.24.0",
|
|
41
|
+
"@aglyn/shared-util-dom": "1.24.0",
|
|
42
|
+
"@aglyn/shared-util-tools": "1.24.0",
|
|
43
|
+
"@aglyn/shared-util-vendor": "1.24.0",
|
|
44
44
|
"@dnd-kit/core": "^6.3.1",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
46
|
"@react-aria/utils": "^3.34.1",
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
18
18
|
* limitations under the License.
|
|
19
19
|
*/ import PluginSettingsField, { PLUGIN_SETTINGS_FIELD_COMPONENT } from "./plugin-settings-field.component.js";
|
|
20
20
|
import { isMediaPickerKind } from "@aglyn/aglyn/app-utils/media-picker-context";
|
|
21
|
-
import { ANIMATION_DEFAULT_DELAY_MS, ANIMATION_DEFAULT_DURATION_MS, ANIMATION_DEFAULT_EASE, ANIMATION_DEFAULT_STAGGER_STEP_MS, ANIMATION_DEFAULT_TRIGGER, ANIMATION_MAX_DURATION_MS, ANIMATION_MAX_STAGGER_STEP_MS, ANIMATION_NONE, ANIMATION_PRESETS, canvas, COMPONENT_PROP_NAME_PATTERN, components, displayBindingTokens, ENTITY_PICKER_BROWSE_LIMIT, entityListState, EntityPickerContext, entityValueNeedsResolution, FEATURE_FLAG, FieldComponentType, getKnownPluginInstalls, getKnownPluginInstallsVersion, hasBindings, inheritedMediaAlt, intrinsicMediaSize, linkTargetKind, VIDEO_COMPONENT_ID, videoMediaProps, MISSING_BINDING_LABEL, NODE_ANIMATION_DELAY_PROP, NODE_ANIMATION_DURATION_PROP, NODE_ANIMATION_EASE_PROP, NODE_ANIMATION_PROP, NODE_ANIMATION_REPEAT_PROP, NODE_ANIMATION_STAGGER_PROP, NODE_ANIMATION_STAGGER_STEP_PROP, NODE_ANIMATION_TRIGGER_PROP, NODE_HIDE_IF_PROP, isPlacedFormNode, formPropsOnBind, FORM_COMPONENT_ID, NODE_HIDE_UNLESS_PROP, normalizeBindingTokens, readInstanceIconValue, readReusablePropValue, readYesNoValue, reusablePropConditionValue, reusablePropDefaultValue, reusablePropKind, reusablePropTakesSeveral, evaluateReusablePropRule, REUSABLE_INSTANCE_COMPONENT_ID, REUSABLE_INSTANCE_PROP_HTML_KEY, REUSABLE_INSTANCE_PROP_VALUES_KEY, listPropFedTextNodeIds, ScreenLinkContext, screenLinkTargetOptions, subscribeKnownPluginInstalls, unresolvedScreenOption } from "@aglyn/aglyn";
|
|
21
|
+
import { ANIMATION_DEFAULT_DELAY_MS, ANIMATION_DEFAULT_DURATION_MS, ANIMATION_DEFAULT_EASE, ANIMATION_DEFAULT_STAGGER_STEP_MS, ANIMATION_DEFAULT_TRIGGER, ANIMATION_MAX_DURATION_MS, ANIMATION_MAX_STAGGER_STEP_MS, ANIMATION_NONE, ANIMATION_PRESETS, canvas, COMPONENT_PROP_NAME_PATTERN, components, displayBindingTokens, ENTITY_PICKER_BROWSE_LIMIT, entityListState, EntityPickerContext, entityValueNeedsResolution, FEATURE_FLAG, FieldComponentType, getKnownPluginInstalls, getKnownPluginInstallsVersion, hasBindings, inheritedMediaAlt, intrinsicMediaSize, linkTargetKind, matchWholeItemToken, RECORD_ICON_FIELD_TYPE, RECORD_ICON_PATH_PART, VIDEO_COMPONENT_ID, videoMediaProps, MISSING_BINDING_LABEL, NODE_ANIMATION_DELAY_PROP, NODE_ANIMATION_DURATION_PROP, NODE_ANIMATION_EASE_PROP, NODE_ANIMATION_PROP, NODE_ANIMATION_REPEAT_PROP, NODE_ANIMATION_STAGGER_PROP, NODE_ANIMATION_STAGGER_STEP_PROP, NODE_ANIMATION_TRIGGER_PROP, NODE_HIDE_IF_PROP, isPlacedFormNode, formPropsOnBind, FORM_COMPONENT_ID, NODE_HIDE_UNLESS_PROP, normalizeBindingTokens, readInstanceIconValue, readReusablePropValue, readYesNoValue, reusablePropConditionValue, reusablePropDefaultValue, reusablePropKind, reusablePropTakesSeveral, evaluateReusablePropRule, REUSABLE_INSTANCE_COMPONENT_ID, REUSABLE_INSTANCE_PROP_HTML_KEY, REUSABLE_INSTANCE_PROP_VALUES_KEY, listPropFedTextNodeIds, ScreenLinkContext, screenLinkTargetOptions, subscribeKnownPluginInstalls, unresolvedScreenOption } from "@aglyn/aglyn";
|
|
22
22
|
// By path, not the `@aglyn/aglyn` barrel: a repeat's bounds and the sources
|
|
23
23
|
// an editor offers are editor business, and a published page must not pull
|
|
24
24
|
// either in behind them.
|
|
@@ -53,7 +53,7 @@ import { readAttributeFieldValue } from "../utils/attribute-field-value.js";
|
|
|
53
53
|
import { besignerDocsUrl } from "../utils/docs-help.js";
|
|
54
54
|
import { buildStyleThemeScales } from "../utils/theme-scale-options.js";
|
|
55
55
|
import { numericTextValue } from "../utils/numeric-text-value.js";
|
|
56
|
-
import useInsertTokenOptions from "../hooks/use-insert-token-options.js";
|
|
56
|
+
import useInsertTokenOptions, { itemFieldBindingOptions } from "../hooks/use-insert-token-options.js";
|
|
57
57
|
import useRepeatSources from "../hooks/use-repeat-sources.js";
|
|
58
58
|
import { InteractionsContext, nodeElementSelector } from "../contexts/interactions-context.js";
|
|
59
59
|
import { MediaPickerContext } from "../contexts/media-picker-context.js";
|
|
@@ -355,6 +355,13 @@ export const elementPropsComponentMapper = _extends({}, simpleComponentMapper, {
|
|
|
355
355
|
paths[pathProp] = undefined;
|
|
356
356
|
continue;
|
|
357
357
|
}
|
|
358
|
+
// Bound to a record's icon field (AGL-4190): each copy of the repeat
|
|
359
|
+
// reads its own record's path, so the path follows the same field.
|
|
360
|
+
const recordField = matchWholeItemToken(pickedId);
|
|
361
|
+
if (recordField) {
|
|
362
|
+
paths[pathProp] = `{{item.${recordField}.${RECORD_ICON_PATH_PART}}}`;
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
358
365
|
const unchanged = pickedId === (stored == null ? void 0 : stored[attribute.name]);
|
|
359
366
|
const storedPath = stored == null ? void 0 : stored[pathProp];
|
|
360
367
|
paths[pathProp] = (_getMdiIconPath = getMdiIconPath(pickedId)) != null ? _getMdiIconPath : unchanged && typeof storedPath === 'string' ? storedPath : undefined;
|
|
@@ -1744,7 +1751,21 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1744
1751
|
// Insert-picker options + pill display-name inputs (AGL-583/586),
|
|
1745
1752
|
// assembled from this node's ancestor context — shared with the
|
|
1746
1753
|
// inline text editor via the extracted hook.
|
|
1747
|
-
const { options: insertOptions, labelContext: tokenLabelContext, inRepeat } = useInsertTokenOptions(node);
|
|
1754
|
+
const { options: insertOptions, labelContext: tokenLabelContext, inRepeat, itemFields, itemNoun, entityLabel: repeatEntityLabel } = useInsertTokenOptions(node);
|
|
1755
|
+
/**
|
|
1756
|
+
* Inside a repeat, an Icon picker can follow a record's icon field
|
|
1757
|
+
* (AGL-4190), which each copy then draws with its own record's icon.
|
|
1758
|
+
* Only icon fields are offered: anything else would hand the picker a
|
|
1759
|
+
* value that is no icon.
|
|
1760
|
+
*/ const recordIconBindings = useMemo(()=>itemFieldBindingOptions({
|
|
1761
|
+
itemFields,
|
|
1762
|
+
itemNoun,
|
|
1763
|
+
entityLabel: repeatEntityLabel
|
|
1764
|
+
}, RECORD_ICON_FIELD_TYPE), [
|
|
1765
|
+
itemFields,
|
|
1766
|
+
itemNoun,
|
|
1767
|
+
repeatEntityLabel
|
|
1768
|
+
]);
|
|
1748
1769
|
// Re-render when the installed-plugin set changes (AGL-1030).
|
|
1749
1770
|
const knownPluginInstallsVersion = useSyncExternalStore(subscribeKnownPluginInstalls, getKnownPluginInstallsVersion, getKnownPluginInstallsVersion);
|
|
1750
1771
|
/**
|
|
@@ -1886,7 +1907,7 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1886
1907
|
}) : field;
|
|
1887
1908
|
};
|
|
1888
1909
|
return (rawAttributes != null ? rawAttributes : []).map(withAttributeHelp).map((field)=>resolveAttributeField(field, resolveContext)).map((field, index)=>{
|
|
1889
|
-
var _rawAttributes_index;
|
|
1910
|
+
var _rawAttributes_index, _rawAttributes_index1;
|
|
1890
1911
|
return(// One field in, one out, so `index` still names the attribute as
|
|
1891
1912
|
// the schema DECLARED it. The rewrites above change `component` —
|
|
1892
1913
|
// a Screen picker is the link lookup by now — and what a field can
|
|
@@ -1895,6 +1916,7 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1895
1916
|
declaredComponent: rawAttributes == null ? void 0 : (_rawAttributes_index = rawAttributes[index]) == null ? void 0 : _rawAttributes_index.component,
|
|
1896
1917
|
declaredField: rawAttributes == null ? void 0 : rawAttributes[index],
|
|
1897
1918
|
componentProps: editedComponentProps,
|
|
1919
|
+
recordBindings: (rawAttributes == null ? void 0 : (_rawAttributes_index1 = rawAttributes[index]) == null ? void 0 : _rawAttributes_index1.component) === FieldComponentType.ICON_PICKER ? recordIconBindings : undefined,
|
|
1898
1920
|
owner: componentPropsOwner,
|
|
1899
1921
|
control: elementPropsComponentMapper[field.component],
|
|
1900
1922
|
tokenLabelContext
|
|
@@ -1918,7 +1940,8 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1918
1940
|
tokenLabelContext,
|
|
1919
1941
|
editedComponentProps,
|
|
1920
1942
|
componentPropsOwner,
|
|
1921
|
-
fieldContext
|
|
1943
|
+
fieldContext,
|
|
1944
|
+
recordIconBindings
|
|
1922
1945
|
]);
|
|
1923
1946
|
// The placed component's properties (AGL-1247), each drawn with the
|
|
1924
1947
|
// control its kind names and finished by the same resolver as the
|