@aglyn/besigner-ui 1.0.0-beta.296 → 1.1.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/besigner.d.ts +1 -0
- package/src/besigner.js +1 -0
- package/src/besigner.js.map +1 -1
- package/src/lib/components/element-props-form.component.d.ts +13 -5
- package/src/lib/components/element-props-form.component.js +19 -10
- package/src/lib/components/element-props-form.component.js.map +1 -1
- package/src/lib/components/node-leaf.js +21 -2
- package/src/lib/components/node-leaf.js.map +1 -1
- package/src/lib/hooks/use-besigner-document.d.ts +14 -0
- package/src/lib/hooks/use-besigner-document.js +19 -1
- package/src/lib/hooks/use-besigner-document.js.map +1 -1
- package/src/lib/hooks/use-besigner-draft.d.ts +22 -0
- package/src/lib/hooks/use-besigner-draft.js +24 -1
- package/src/lib/hooks/use-besigner-draft.js.map +1 -1
- package/src/lib/hooks/use-besigner-open-draft-param.d.ts +24 -0
- package/src/lib/hooks/use-besigner-open-draft-param.js +37 -0
- package/src/lib/hooks/use-besigner-open-draft-param.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/besigner-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.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.1.0",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.1.0",
|
|
30
|
+
"@aglyn/aglyn-node-renderer": "1.1.0",
|
|
31
|
+
"@aglyn/besigner": "1.1.0",
|
|
32
|
+
"@aglyn/shared-data-enums": "1.1.0",
|
|
33
|
+
"@aglyn/shared-data-mdi": "1.1.0",
|
|
34
|
+
"@aglyn/shared-data-types": "1.1.0",
|
|
35
|
+
"@aglyn/shared-svg-icons": "1.1.0",
|
|
36
|
+
"@aglyn/shared-ui-json-editor": "1.1.0",
|
|
37
|
+
"@aglyn/shared-ui-jsx": "1.1.0",
|
|
38
|
+
"@aglyn/shared-ui-jsx-forms": "1.1.0",
|
|
39
|
+
"@aglyn/shared-ui-snackstack": "1.1.0",
|
|
40
|
+
"@aglyn/shared-ui-theme": "1.1.0",
|
|
41
|
+
"@aglyn/shared-util-dom": "1.1.0",
|
|
42
|
+
"@aglyn/shared-util-tools": "1.1.0",
|
|
43
|
+
"@aglyn/shared-util-vendor": "1.1.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",
|
package/src/besigner.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from './lib/hooks/use-aglyn-besigner-panel-value';
|
|
|
27
27
|
export * from './lib/hooks/use-besigner-app-context';
|
|
28
28
|
export * from './lib/hooks/use-besigner-document';
|
|
29
29
|
export * from './lib/hooks/use-besigner-draft';
|
|
30
|
+
export { useBesignerOpenDraftParam } from './lib/hooks/use-besigner-open-draft-param';
|
|
30
31
|
export * from './lib/hooks/use-component-propagation-notice';
|
|
31
32
|
export * from './lib/hooks/use-debounced-commit';
|
|
32
33
|
export * from './lib/hooks/use-delete-element-callback';
|
package/src/besigner.js
CHANGED
|
@@ -26,6 +26,7 @@ export * from "./lib/hooks/use-aglyn-besigner-panel-value.js";
|
|
|
26
26
|
export * from "./lib/hooks/use-besigner-app-context.js";
|
|
27
27
|
export * from "./lib/hooks/use-besigner-document.js";
|
|
28
28
|
export * from "./lib/hooks/use-besigner-draft.js";
|
|
29
|
+
export { useBesignerOpenDraftParam } from "./lib/hooks/use-besigner-open-draft-param.js";
|
|
29
30
|
export * from "./lib/hooks/use-component-propagation-notice.js";
|
|
30
31
|
export * from "./lib/hooks/use-debounced-commit.js";
|
|
31
32
|
export * from "./lib/hooks/use-delete-element-callback.js";
|
package/src/besigner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../libs/besigner/feature/designer/src/besigner.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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\nexport * from './lib/drafts/besigner-draft-store'\nexport * from './lib/drafts/besigner-server-draft'\n\nexport * from './lib/constants/sample-data'\nexport * from './lib/constants/shared'\n\nexport * from './lib/utils/docs-help'\nexport * from './lib/utils/publish-failure-message'\n\nexport * from './lib/hooks/use-add-element-drawer-callback'\nexport * from './lib/hooks/use-aglyn-besigner-flag'\nexport * from './lib/hooks/use-aglyn-besigner-panel'\nexport * from './lib/hooks/use-aglyn-besigner-panel-value'\nexport * from './lib/hooks/use-besigner-app-context'\nexport * from './lib/hooks/use-besigner-document'\nexport * from './lib/hooks/use-besigner-draft'\nexport * from './lib/hooks/use-component-propagation-notice'\nexport * from './lib/hooks/use-debounced-commit'\nexport * from './lib/hooks/use-delete-element-callback'\nexport * from './lib/hooks/use-document-repair-callbacks'\nexport * from './lib/hooks/use-insert-token-options'\nexport * from './lib/hooks/use-leaf-drag'\nexport * from './lib/hooks/use-leaf-drop'\nexport * from './lib/hooks/use-media-asset-facts-overlay'\n\nexport * from './lib/contexts/toolbar-extras-context'\nexport * from './lib/contexts/binding-picker-context'\nexport * from './lib/contexts/component-promotion-context'\nexport * from './lib/contexts/components-drawer-context.provider'\nexport * from './lib/contexts/element-drawer-context'\nexport * from './lib/contexts/inspector-extras-context'\nexport * from './lib/contexts/interactions-context'\nexport * from './lib/contexts/layout-chrome-context'\n// A screen restyling its shared layout's elements for itself (AGL-3286).\nexport * from './lib/contexts/layout-style-selection'\nexport * from './lib/components/layout-style-picker.component'\nexport * from './lib/contexts/media-asset-facts-context'\nexport * from './lib/contexts/media-picker-context'\nexport * from './lib/contexts/rendered-canvas-elements'\n\nexport * from './lib/components/accordion-list.component'\nexport * from './lib/components/add-controls.component'\nexport * from './lib/components/app-bar-breadcrumbs.component'\nexport * from './lib/components/app-bar-primary.component'\nexport * from './lib/components/app-bar-secondary.component'\nexport * from './lib/components/aside-panel.component'\nexport * from './lib/components/besigner-dnd-context.component'\nexport * from './lib/components/besigner-conflict-alert.component'\nexport * from './lib/components/besigner-draft-alert.component'\nexport * from './lib/components/besigner-root-provider.component'\nexport * from './lib/components/closeable-drawer.component'\nexport * from './lib/components/component-accordion-list'\nexport * from './lib/components/component-icon.component'\nexport * from './lib/components/components-grid-list.component'\nexport * from './lib/components/device-preview-controls.component'\nexport * from './lib/components/element-props-form.component'\nexport * from './lib/components/element-styles-form-template.component'\nexport * from './lib/components/element-styles-form.component'\nexport * from './lib/components/history-controls.component'\nexport * from './lib/components/interact-controls.component'\nexport * from './lib/components/node-card'\nexport * from './lib/components/node-context-menu'\nexport * from './lib/components/node-leaf'\nexport * from './lib/components/node-outline'\nexport * from './lib/components/node-overlay'\nexport * from './lib/components/node-quick-actions'\nexport * from './lib/components/node-tree-view'\nexport * from './lib/components/panel-controls.component'\nexport * from './lib/components/properties-dialog.component'\nexport * from './lib/components/property-values-form.component'\nexport * from './lib/components/scheme-preview-controls.component'\nexport * from './lib/components/screen-link-field.component'\nexport * from './lib/components/token-pill.component'\nexport * from './lib/components/token-text-field.component'\nexport * from './lib/components/viewport-canvas.component'\nexport * from './lib/components/viewport-frame.component'\nexport * from './lib/components/viewport-root.component'\nexport * from './lib/components/viewport-zoom-controls'\nexport * from './lib/components/workspace-editor.component'\nexport * from './lib/components/workspace-panel.component'\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,uCAAmC;AACjD,cAAc,wCAAoC;AAElD,cAAc,iCAA6B;AAC3C,cAAc,4BAAwB;AAEtC,cAAc,2BAAuB;AACrC,cAAc,yCAAqC;AAEnD,cAAc,iDAA6C;AAC3D,cAAc,yCAAqC;AACnD,cAAc,0CAAsC;AACpD,cAAc,gDAA4C;AAC1D,cAAc,0CAAsC;AACpD,cAAc,uCAAmC;AACjD,cAAc,oCAAgC;AAC9C,cAAc,kDAA8C;AAC5D,cAAc,sCAAkC;AAChD,cAAc,6CAAyC;AACvD,cAAc,+CAA2C;AACzD,cAAc,0CAAsC;AACpD,cAAc,+BAA2B;AACzC,cAAc,+BAA2B;AACzC,cAAc,+CAA2C;AAEzD,cAAc,2CAAuC;AACrD,cAAc,2CAAuC;AACrD,cAAc,gDAA4C;AAC1D,cAAc,uDAAmD;AACjE,cAAc,2CAAuC;AACrD,cAAc,6CAAyC;AACvD,cAAc,yCAAqC;AACnD,cAAc,0CAAsC;AACpD,yEAAyE;AACzE,cAAc,2CAAuC;AACrD,cAAc,oDAAgD;AAC9D,cAAc,8CAA0C;AACxD,cAAc,yCAAqC;AACnD,cAAc,6CAAyC;AAEvD,cAAc,+CAA2C;AACzD,cAAc,6CAAyC;AACvD,cAAc,oDAAgD;AAC9D,cAAc,gDAA4C;AAC1D,cAAc,kDAA8C;AAC5D,cAAc,4CAAwC;AACtD,cAAc,qDAAiD;AAC/D,cAAc,wDAAoD;AAClE,cAAc,qDAAiD;AAC/D,cAAc,uDAAmD;AACjE,cAAc,iDAA6C;AAC3D,cAAc,+CAA2C;AACzD,cAAc,+CAA2C;AACzD,cAAc,qDAAiD;AAC/D,cAAc,wDAAoD;AAClE,cAAc,mDAA+C;AAC7D,cAAc,6DAAyD;AACvE,cAAc,oDAAgD;AAC9D,cAAc,iDAA6C;AAC3D,cAAc,kDAA8C;AAC5D,cAAc,gCAA4B;AAC1C,cAAc,wCAAoC;AAClD,cAAc,gCAA4B;AAC1C,cAAc,mCAA+B;AAC7C,cAAc,mCAA+B;AAC7C,cAAc,yCAAqC;AACnD,cAAc,qCAAiC;AAC/C,cAAc,+CAA2C;AACzD,cAAc,kDAA8C;AAC5D,cAAc,qDAAiD;AAC/D,cAAc,wDAAoD;AAClE,cAAc,kDAA8C;AAC5D,cAAc,2CAAuC;AACrD,cAAc,iDAA6C;AAC3D,cAAc,gDAA4C;AAC1D,cAAc,+CAA2C;AACzD,cAAc,8CAA0C;AACxD,cAAc,6CAAyC;AACvD,cAAc,iDAA6C;AAC3D,cAAc,gDAA4C"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../libs/besigner/feature/designer/src/besigner.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2023 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\nexport * from './lib/drafts/besigner-draft-store'\nexport * from './lib/drafts/besigner-server-draft'\n\nexport * from './lib/constants/sample-data'\nexport * from './lib/constants/shared'\n\nexport * from './lib/utils/docs-help'\nexport * from './lib/utils/publish-failure-message'\n\nexport * from './lib/hooks/use-add-element-drawer-callback'\nexport * from './lib/hooks/use-aglyn-besigner-flag'\nexport * from './lib/hooks/use-aglyn-besigner-panel'\nexport * from './lib/hooks/use-aglyn-besigner-panel-value'\nexport * from './lib/hooks/use-besigner-app-context'\nexport * from './lib/hooks/use-besigner-document'\nexport * from './lib/hooks/use-besigner-draft'\nexport { useBesignerOpenDraftParam } from './lib/hooks/use-besigner-open-draft-param'\nexport * from './lib/hooks/use-component-propagation-notice'\nexport * from './lib/hooks/use-debounced-commit'\nexport * from './lib/hooks/use-delete-element-callback'\nexport * from './lib/hooks/use-document-repair-callbacks'\nexport * from './lib/hooks/use-insert-token-options'\nexport * from './lib/hooks/use-leaf-drag'\nexport * from './lib/hooks/use-leaf-drop'\nexport * from './lib/hooks/use-media-asset-facts-overlay'\n\nexport * from './lib/contexts/toolbar-extras-context'\nexport * from './lib/contexts/binding-picker-context'\nexport * from './lib/contexts/component-promotion-context'\nexport * from './lib/contexts/components-drawer-context.provider'\nexport * from './lib/contexts/element-drawer-context'\nexport * from './lib/contexts/inspector-extras-context'\nexport * from './lib/contexts/interactions-context'\nexport * from './lib/contexts/layout-chrome-context'\n// A screen restyling its shared layout's elements for itself (AGL-3286).\nexport * from './lib/contexts/layout-style-selection'\nexport * from './lib/components/layout-style-picker.component'\nexport * from './lib/contexts/media-asset-facts-context'\nexport * from './lib/contexts/media-picker-context'\nexport * from './lib/contexts/rendered-canvas-elements'\n\nexport * from './lib/components/accordion-list.component'\nexport * from './lib/components/add-controls.component'\nexport * from './lib/components/app-bar-breadcrumbs.component'\nexport * from './lib/components/app-bar-primary.component'\nexport * from './lib/components/app-bar-secondary.component'\nexport * from './lib/components/aside-panel.component'\nexport * from './lib/components/besigner-dnd-context.component'\nexport * from './lib/components/besigner-conflict-alert.component'\nexport * from './lib/components/besigner-draft-alert.component'\nexport * from './lib/components/besigner-root-provider.component'\nexport * from './lib/components/closeable-drawer.component'\nexport * from './lib/components/component-accordion-list'\nexport * from './lib/components/component-icon.component'\nexport * from './lib/components/components-grid-list.component'\nexport * from './lib/components/device-preview-controls.component'\nexport * from './lib/components/element-props-form.component'\nexport * from './lib/components/element-styles-form-template.component'\nexport * from './lib/components/element-styles-form.component'\nexport * from './lib/components/history-controls.component'\nexport * from './lib/components/interact-controls.component'\nexport * from './lib/components/node-card'\nexport * from './lib/components/node-context-menu'\nexport * from './lib/components/node-leaf'\nexport * from './lib/components/node-outline'\nexport * from './lib/components/node-overlay'\nexport * from './lib/components/node-quick-actions'\nexport * from './lib/components/node-tree-view'\nexport * from './lib/components/panel-controls.component'\nexport * from './lib/components/properties-dialog.component'\nexport * from './lib/components/property-values-form.component'\nexport * from './lib/components/scheme-preview-controls.component'\nexport * from './lib/components/screen-link-field.component'\nexport * from './lib/components/token-pill.component'\nexport * from './lib/components/token-text-field.component'\nexport * from './lib/components/viewport-canvas.component'\nexport * from './lib/components/viewport-frame.component'\nexport * from './lib/components/viewport-root.component'\nexport * from './lib/components/viewport-zoom-controls'\nexport * from './lib/components/workspace-editor.component'\nexport * from './lib/components/workspace-panel.component'\n"],"names":["useBesignerOpenDraftParam"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,uCAAmC;AACjD,cAAc,wCAAoC;AAElD,cAAc,iCAA6B;AAC3C,cAAc,4BAAwB;AAEtC,cAAc,2BAAuB;AACrC,cAAc,yCAAqC;AAEnD,cAAc,iDAA6C;AAC3D,cAAc,yCAAqC;AACnD,cAAc,0CAAsC;AACpD,cAAc,gDAA4C;AAC1D,cAAc,0CAAsC;AACpD,cAAc,uCAAmC;AACjD,cAAc,oCAAgC;AAC9C,SAASA,yBAAyB,QAAQ,+CAA2C;AACrF,cAAc,kDAA8C;AAC5D,cAAc,sCAAkC;AAChD,cAAc,6CAAyC;AACvD,cAAc,+CAA2C;AACzD,cAAc,0CAAsC;AACpD,cAAc,+BAA2B;AACzC,cAAc,+BAA2B;AACzC,cAAc,+CAA2C;AAEzD,cAAc,2CAAuC;AACrD,cAAc,2CAAuC;AACrD,cAAc,gDAA4C;AAC1D,cAAc,uDAAmD;AACjE,cAAc,2CAAuC;AACrD,cAAc,6CAAyC;AACvD,cAAc,yCAAqC;AACnD,cAAc,0CAAsC;AACpD,yEAAyE;AACzE,cAAc,2CAAuC;AACrD,cAAc,oDAAgD;AAC9D,cAAc,8CAA0C;AACxD,cAAc,yCAAqC;AACnD,cAAc,6CAAyC;AAEvD,cAAc,+CAA2C;AACzD,cAAc,6CAAyC;AACvD,cAAc,oDAAgD;AAC9D,cAAc,gDAA4C;AAC1D,cAAc,kDAA8C;AAC5D,cAAc,4CAAwC;AACtD,cAAc,qDAAiD;AAC/D,cAAc,wDAAoD;AAClE,cAAc,qDAAiD;AAC/D,cAAc,uDAAmD;AACjE,cAAc,iDAA6C;AAC3D,cAAc,+CAA2C;AACzD,cAAc,+CAA2C;AACzD,cAAc,qDAAiD;AAC/D,cAAc,wDAAoD;AAClE,cAAc,mDAA+C;AAC7D,cAAc,6DAAyD;AACvE,cAAc,oDAAgD;AAC9D,cAAc,iDAA6C;AAC3D,cAAc,kDAA8C;AAC5D,cAAc,gCAA4B;AAC1C,cAAc,wCAAoC;AAClD,cAAc,gCAA4B;AAC1C,cAAc,mCAA+B;AAC7C,cAAc,mCAA+B;AAC7C,cAAc,yCAAqC;AACnD,cAAc,qCAAiC;AAC/C,cAAc,+CAA2C;AACzD,cAAc,kDAA8C;AAC5D,cAAc,qDAAiD;AAC/D,cAAc,wDAAoD;AAClE,cAAc,kDAA8C;AAC5D,cAAc,2CAAuC;AACrD,cAAc,iDAA6C;AAC3D,cAAc,gDAA4C;AAC1D,cAAc,+CAA2C;AACzD,cAAc,8CAA0C;AACxD,cAAc,6CAAyC;AACvD,cAAc,iDAA6C;AAC3D,cAAc,gDAA4C"}
|
|
@@ -369,6 +369,13 @@ export declare function browseMediaKind(options: {
|
|
|
369
369
|
*/
|
|
370
370
|
attributeKind?: unknown;
|
|
371
371
|
}): Aglyn.MediaPickerKind | undefined;
|
|
372
|
+
/**
|
|
373
|
+
* Whether an element is offered the two visibility fields: inside a component
|
|
374
|
+
* editor, and wherever it already carries a directive, like the logo and name
|
|
375
|
+
* of a new site's header (AGL-4119), so what decides whether it shows can be
|
|
376
|
+
* read and changed where the element is edited.
|
|
377
|
+
*/
|
|
378
|
+
export declare function offersVisibilityFields(nodeProps: Record<string, unknown> | null | undefined, inComponentEditor: boolean): boolean;
|
|
372
379
|
/**
|
|
373
380
|
* The two visibility fields every node inside a component definition gets
|
|
374
381
|
* (AGL-1314), so "this part is optional" is something an author declares by
|
|
@@ -379,11 +386,12 @@ export declare function browseMediaKind(options: {
|
|
|
379
386
|
* mockup"), `hideUnless` takes the prop that would have supplied the
|
|
380
387
|
* content ("no link, no button" — AGL-1348).
|
|
381
388
|
*
|
|
382
|
-
* Offered
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
*
|
|
389
|
+
* Offered where `{{prop.*}}` exists — inside a component editor, signalled by
|
|
390
|
+
* `BindingPickerContext.componentProps` exactly as the insert picker uses it —
|
|
391
|
+
* and on an element that already carries one ({@link offersVisibilityFields}).
|
|
392
|
+
* Anywhere else a directive is inert (the graft is the only thing that
|
|
393
|
+
* evaluates a literal one), and a field that silently does nothing is worse
|
|
394
|
+
* than no field.
|
|
387
395
|
*/
|
|
388
396
|
export declare function buildVisibilityFields(tokenOptions?: unknown, tokenLabelContext?: unknown): Array<Record<string, unknown>>;
|
|
389
397
|
/**
|
|
@@ -967,6 +967,14 @@ export const elementPropsComponentMapper = _extends({}, simpleComponentMapper, {
|
|
|
967
967
|
if (propName === 'poster') return 'image';
|
|
968
968
|
return undefined;
|
|
969
969
|
}
|
|
970
|
+
/**
|
|
971
|
+
* Whether an element is offered the two visibility fields: inside a component
|
|
972
|
+
* editor, and wherever it already carries a directive, like the logo and name
|
|
973
|
+
* of a new site's header (AGL-4119), so what decides whether it shows can be
|
|
974
|
+
* read and changed where the element is edited.
|
|
975
|
+
*/ export function offersVisibilityFields(nodeProps, inComponentEditor) {
|
|
976
|
+
return inComponentEditor || Boolean((nodeProps == null ? void 0 : nodeProps[NODE_HIDE_IF_PROP]) || (nodeProps == null ? void 0 : nodeProps[NODE_HIDE_UNLESS_PROP]));
|
|
977
|
+
}
|
|
970
978
|
/**
|
|
971
979
|
* The two visibility fields every node inside a component definition gets
|
|
972
980
|
* (AGL-1314), so "this part is optional" is something an author declares by
|
|
@@ -977,11 +985,12 @@ export const elementPropsComponentMapper = _extends({}, simpleComponentMapper, {
|
|
|
977
985
|
* mockup"), `hideUnless` takes the prop that would have supplied the
|
|
978
986
|
* content ("no link, no button" — AGL-1348).
|
|
979
987
|
*
|
|
980
|
-
* Offered
|
|
981
|
-
*
|
|
982
|
-
*
|
|
983
|
-
*
|
|
984
|
-
*
|
|
988
|
+
* Offered where `{{prop.*}}` exists — inside a component editor, signalled by
|
|
989
|
+
* `BindingPickerContext.componentProps` exactly as the insert picker uses it —
|
|
990
|
+
* and on an element that already carries one ({@link offersVisibilityFields}).
|
|
991
|
+
* Anywhere else a directive is inert (the graft is the only thing that
|
|
992
|
+
* evaluates a literal one), and a field that silently does nothing is worse
|
|
993
|
+
* than no field.
|
|
985
994
|
*/ export function buildVisibilityFields(tokenOptions, tokenLabelContext) {
|
|
986
995
|
const field = (name, label, description)=>({
|
|
987
996
|
name,
|
|
@@ -1913,11 +1922,11 @@ const ElementPropsFormRaw = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
1913
1922
|
resolveContext,
|
|
1914
1923
|
themeScales
|
|
1915
1924
|
]);
|
|
1916
|
-
// Visibility directives (AGL-1314)
|
|
1917
|
-
//
|
|
1918
|
-
|
|
1919
|
-
const visibilityFields = useMemo(()=>
|
|
1920
|
-
|
|
1925
|
+
// Visibility directives (AGL-1314). `componentProps` is the same "am I
|
|
1926
|
+
// editing a definition" signal the insert picker keys `{{prop.*}}` off.
|
|
1927
|
+
const offersVisibility = offersVisibilityFields(nodeProps, Boolean(editedComponentProps));
|
|
1928
|
+
const visibilityFields = useMemo(()=>offersVisibility ? buildVisibilityFields(insertOptions, tokenLabelContext) : [], [
|
|
1929
|
+
offersVisibility,
|
|
1921
1930
|
insertOptions,
|
|
1922
1931
|
tokenLabelContext
|
|
1923
1932
|
]);
|