@aglyn/besigner-ui 1.0.0-beta.236 → 1.0.0-beta.238

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/besigner-ui",
3
- "version": "1.0.0-beta.236",
3
+ "version": "1.0.0-beta.238",
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.236",
29
- "@aglyn/aglyn-markdown-editor": "1.0.0-beta.236",
30
- "@aglyn/aglyn-node-renderer": "1.0.0-beta.236",
31
- "@aglyn/besigner": "1.0.0-beta.236",
32
- "@aglyn/shared-data-enums": "1.0.0-beta.236",
33
- "@aglyn/shared-data-mdi": "1.0.0-beta.236",
34
- "@aglyn/shared-data-types": "1.0.0-beta.236",
35
- "@aglyn/shared-svg-icons": "1.0.0-beta.236",
36
- "@aglyn/shared-ui-json-editor": "1.0.0-beta.236",
37
- "@aglyn/shared-ui-jsx": "1.0.0-beta.236",
38
- "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.236",
39
- "@aglyn/shared-ui-snackstack": "1.0.0-beta.236",
40
- "@aglyn/shared-ui-theme": "1.0.0-beta.236",
41
- "@aglyn/shared-util-dom": "1.0.0-beta.236",
42
- "@aglyn/shared-util-tools": "1.0.0-beta.236",
43
- "@aglyn/shared-util-vendor": "1.0.0-beta.236",
28
+ "@aglyn/aglyn": "1.0.0-beta.238",
29
+ "@aglyn/aglyn-markdown-editor": "1.0.0-beta.238",
30
+ "@aglyn/aglyn-node-renderer": "1.0.0-beta.238",
31
+ "@aglyn/besigner": "1.0.0-beta.238",
32
+ "@aglyn/shared-data-enums": "1.0.0-beta.238",
33
+ "@aglyn/shared-data-mdi": "1.0.0-beta.238",
34
+ "@aglyn/shared-data-types": "1.0.0-beta.238",
35
+ "@aglyn/shared-svg-icons": "1.0.0-beta.238",
36
+ "@aglyn/shared-ui-json-editor": "1.0.0-beta.238",
37
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.238",
38
+ "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.238",
39
+ "@aglyn/shared-ui-snackstack": "1.0.0-beta.238",
40
+ "@aglyn/shared-ui-theme": "1.0.0-beta.238",
41
+ "@aglyn/shared-util-dom": "1.0.0-beta.238",
42
+ "@aglyn/shared-util-tools": "1.0.0-beta.238",
43
+ "@aglyn/shared-util-vendor": "1.0.0-beta.238",
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
- ].map(withNumericValueParse), [
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