@aglyn/besigner-ui 1.0.0-beta.235 → 1.0.0-beta.237
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.d.ts +6 -0
- package/src/lib/components/element-props-form.component.js +16 -4
- package/src/lib/components/element-props-form.component.js.map +1 -1
- package/src/lib/hooks/use-besigner-document.d.ts +11 -0
- package/src/lib/hooks/use-besigner-document.js +46 -0
- package/src/lib/hooks/use-besigner-document.js.map +1 -1
- package/src/lib/hooks/use-besigner-draft.js +44 -11
- package/src/lib/hooks/use-besigner-draft.js.map +1 -1
- package/src/lib/utils/docs-help.generated.d.ts +1 -1
- package/src/lib/utils/docs-help.generated.js +1 -0
- package/src/lib/utils/docs-help.generated.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/besigner-ui",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.237",
|
|
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.0.0-beta.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.
|
|
30
|
-
"@aglyn/aglyn-node-renderer": "1.0.0-beta.
|
|
31
|
-
"@aglyn/besigner": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-data-types": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-svg-icons": "1.0.0-beta.
|
|
36
|
-
"@aglyn/shared-ui-json-editor": "1.0.0-beta.
|
|
37
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
38
|
-
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.
|
|
39
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
40
|
-
"@aglyn/shared-ui-theme": "1.0.0-beta.
|
|
41
|
-
"@aglyn/shared-util-dom": "1.0.0-beta.
|
|
42
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
43
|
-
"@aglyn/shared-util-vendor": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.237",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.0.0-beta.237",
|
|
30
|
+
"@aglyn/aglyn-node-renderer": "1.0.0-beta.237",
|
|
31
|
+
"@aglyn/besigner": "1.0.0-beta.237",
|
|
32
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.237",
|
|
33
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.237",
|
|
34
|
+
"@aglyn/shared-data-types": "1.0.0-beta.237",
|
|
35
|
+
"@aglyn/shared-svg-icons": "1.0.0-beta.237",
|
|
36
|
+
"@aglyn/shared-ui-json-editor": "1.0.0-beta.237",
|
|
37
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.237",
|
|
38
|
+
"@aglyn/shared-ui-jsx-forms": "1.0.0-beta.237",
|
|
39
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.237",
|
|
40
|
+
"@aglyn/shared-ui-theme": "1.0.0-beta.237",
|
|
41
|
+
"@aglyn/shared-util-dom": "1.0.0-beta.237",
|
|
42
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.237",
|
|
43
|
+
"@aglyn/shared-util-vendor": "1.0.0-beta.237",
|
|
44
44
|
"@dnd-kit/core": "^6.3.1",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
46
|
"@react-aria/utils": "^3.34.1",
|
|
@@ -349,6 +349,12 @@ export declare function browseMediaKind(options: {
|
|
|
349
349
|
componentId?: unknown;
|
|
350
350
|
/** The attribute the Browse button was pressed for. */
|
|
351
351
|
propName: string;
|
|
352
|
+
/**
|
|
353
|
+
* The kind the attribute's own schema declares (`mediaKind`, AGL-3716), so
|
|
354
|
+
* a plugin's element narrows its picker without core naming its id: the
|
|
355
|
+
* Music player's `src` lists only audio.
|
|
356
|
+
*/
|
|
357
|
+
attributeKind?: unknown;
|
|
352
358
|
}): Aglyn.MediaPickerKind | undefined;
|
|
353
359
|
/**
|
|
354
360
|
* The two visibility fields every node inside a component definition gets
|
|
@@ -17,6 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
17
17
|
* See the License for the specific language governing permissions and
|
|
18
18
|
* limitations under the License.
|
|
19
19
|
*/ import PluginSettingsField, { PLUGIN_SETTINGS_FIELD_COMPONENT } from "./plugin-settings-field.component.js";
|
|
20
|
+
import { isMediaPickerKind } from "@aglyn/aglyn/app-utils/media-picker-context";
|
|
20
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_VALUES_KEY, ScreenLinkContext, screenLinkTargetOptions, subscribeKnownPluginInstalls, unresolvedScreenOption } from "@aglyn/aglyn";
|
|
21
22
|
// By path, not the `@aglyn/aglyn` barrel: a repeat's bounds and the sources
|
|
22
23
|
// an editor offers are editor business, and a published page must not pull
|
|
@@ -924,7 +925,8 @@ export const elementPropsComponentMapper = _extends({}, simpleComponentMapper, {
|
|
|
924
925
|
* Exported and pure for the reason {@link inheritedAltPatch} is; keyed on the
|
|
925
926
|
* persisted component id, which is never renamed.
|
|
926
927
|
*/ export function browseMediaKind(options) {
|
|
927
|
-
const { componentId, propName } = options != null ? options : {};
|
|
928
|
+
const { componentId, propName, attributeKind } = options != null ? options : {};
|
|
929
|
+
if (isMediaPickerKind(attributeKind)) return attributeKind;
|
|
928
930
|
if (componentId !== VIDEO_COMPONENT_ID) return undefined;
|
|
929
931
|
if (propName === 'src') return 'video';
|
|
930
932
|
if (propName === 'poster') return 'image';
|
|
@@ -1893,7 +1895,14 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1893
1895
|
...visibilityFields,
|
|
1894
1896
|
...animationFields,
|
|
1895
1897
|
...repeatFields
|
|
1896
|
-
]
|
|
1898
|
+
]// `mediaKind` is read by the picker (AGL-3716), never by the field
|
|
1899
|
+
// it would otherwise reach as an unknown DOM attribute.
|
|
1900
|
+
.map((_0)=>{
|
|
1901
|
+
let { mediaKind: _mediaKind } = _0, field = _object_without_properties_loose(_0, [
|
|
1902
|
+
"mediaKind"
|
|
1903
|
+
]);
|
|
1904
|
+
return field;
|
|
1905
|
+
}).map(withNumericValueParse), [
|
|
1897
1906
|
attributes,
|
|
1898
1907
|
instancePropFields,
|
|
1899
1908
|
visibilityFields,
|
|
@@ -1995,10 +2004,12 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1995
2004
|
node
|
|
1996
2005
|
]);
|
|
1997
2006
|
const handleBrowseMedia = useCallback((propName)=>()=>{
|
|
2007
|
+
var _find;
|
|
1998
2008
|
// The one kind this attribute can hold, when there is one (AGL-2953).
|
|
1999
2009
|
const kind = browseMediaKind({
|
|
2000
2010
|
componentId: node == null ? void 0 : node.componentId,
|
|
2001
|
-
propName
|
|
2011
|
+
propName,
|
|
2012
|
+
attributeKind: (_find = (rawAttributes != null ? rawAttributes : []).find((field)=>(field == null ? void 0 : field.name) === propName)) == null ? void 0 : _find.mediaKind
|
|
2002
2013
|
});
|
|
2003
2014
|
// Written through verbatim: the host app decides the persisted form
|
|
2004
2015
|
// (today a media reference — AGL-1215), the renderer resolves it.
|
|
@@ -2028,7 +2039,8 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
2028
2039
|
}, [
|
|
2029
2040
|
onPickMedia,
|
|
2030
2041
|
node,
|
|
2031
|
-
declaresAlt
|
|
2042
|
+
declaresAlt,
|
|
2043
|
+
rawAttributes
|
|
2032
2044
|
]);
|
|
2033
2045
|
// The same picker for an instance's image-typed declared prop, writing
|
|
2034
2046
|
// into the nested `propValues` object (AGL-1247). Both levels are
|