@aglyn/besigner-ui 1.0.0-beta.172 → 1.0.0-beta.174

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.
Files changed (56) hide show
  1. package/package.json +17 -17
  2. package/src/besigner.d.ts +2 -0
  3. package/src/besigner.js +3 -0
  4. package/src/besigner.js.map +1 -1
  5. package/src/lib/components/aside-panel.component.js +85 -3
  6. package/src/lib/components/aside-panel.component.js.map +1 -1
  7. package/src/lib/components/custom-css-form.component.d.ts +5 -0
  8. package/src/lib/components/custom-css-form.component.js +6 -3
  9. package/src/lib/components/custom-css-form.component.js.map +1 -1
  10. package/src/lib/components/dnd/draggable-droppable.js +26 -3
  11. package/src/lib/components/dnd/draggable-droppable.js.map +1 -1
  12. package/src/lib/components/element-preview.component.js +28 -19
  13. package/src/lib/components/element-preview.component.js.map +1 -1
  14. package/src/lib/components/element-props-form.component.d.ts +11 -1
  15. package/src/lib/components/element-props-form.component.js +58 -9
  16. package/src/lib/components/element-props-form.component.js.map +1 -1
  17. package/src/lib/components/element-styles-form.component.d.ts +7 -22
  18. package/src/lib/components/element-styles-form.component.js +250 -80
  19. package/src/lib/components/element-styles-form.component.js.map +1 -1
  20. package/src/lib/components/instance-attr-overrides.component.js +180 -124
  21. package/src/lib/components/instance-attr-overrides.component.js.map +1 -1
  22. package/src/lib/components/layout-style-picker.component.d.ts +43 -0
  23. package/src/lib/components/layout-style-picker.component.js +159 -0
  24. package/src/lib/components/layout-style-picker.component.js.map +1 -0
  25. package/src/lib/components/node-leaf.js +14 -4
  26. package/src/lib/components/node-leaf.js.map +1 -1
  27. package/src/lib/components/placement-parts-header.component.d.ts +52 -0
  28. package/src/lib/components/placement-parts-header.component.js +178 -0
  29. package/src/lib/components/placement-parts-header.component.js.map +1 -0
  30. package/src/lib/components/viewport-frame.component.d.ts +2 -1
  31. package/src/lib/components/viewport-frame.component.js +31 -16
  32. package/src/lib/components/viewport-frame.component.js.map +1 -1
  33. package/src/lib/contexts/layout-chrome-context.d.ts +7 -0
  34. package/src/lib/contexts/layout-chrome-context.js +6 -4
  35. package/src/lib/contexts/layout-chrome-context.js.map +1 -1
  36. package/src/lib/contexts/layout-style-selection.d.ts +52 -0
  37. package/src/lib/contexts/layout-style-selection.js +51 -0
  38. package/src/lib/contexts/layout-style-selection.js.map +1 -0
  39. package/src/lib/utils/attr-target.d.ts +25 -3
  40. package/src/lib/utils/attr-target.js +39 -11
  41. package/src/lib/utils/attr-target.js.map +1 -1
  42. package/src/lib/utils/docs-help.generated.d.ts +3 -3
  43. package/src/lib/utils/docs-help.generated.js +3 -0
  44. package/src/lib/utils/docs-help.generated.js.map +1 -1
  45. package/src/lib/utils/instance-leaf-hit.d.ts +23 -1
  46. package/src/lib/utils/instance-leaf-hit.js +37 -3
  47. package/src/lib/utils/instance-leaf-hit.js.map +1 -1
  48. package/src/lib/utils/placement-override-copy.d.ts +135 -0
  49. package/src/lib/utils/placement-override-copy.js +314 -0
  50. package/src/lib/utils/placement-override-copy.js.map +1 -0
  51. package/src/lib/utils/placement-part-pick.d.ts +52 -0
  52. package/src/lib/utils/placement-part-pick.js +47 -0
  53. package/src/lib/utils/placement-part-pick.js.map +1 -0
  54. package/src/lib/utils/style-target.d.ts +73 -2
  55. package/src/lib/utils/style-target.js +100 -6
  56. package/src/lib/utils/style-target.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.172",
3
+ "version": "1.0.0-beta.174",
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.172",
29
- "@aglyn/aglyn-markdown-editor": "1.0.0-beta.172",
30
- "@aglyn/aglyn-node-renderer": "1.0.0-beta.172",
31
- "@aglyn/besigner": "1.0.0-beta.172",
32
- "@aglyn/shared-data-enums": "1.0.0-beta.172",
33
- "@aglyn/shared-data-mdi": "1.0.0-beta.172",
34
- "@aglyn/shared-data-types": "1.0.0-beta.172",
35
- "@aglyn/shared-svg-icons": "1.0.0-beta.172",
36
- "@aglyn/shared-ui-json-editor": "1.0.0-beta.172",
37
- "@aglyn/shared-ui-jsx": "1.0.0-beta.172",
38
- "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.172",
39
- "@aglyn/shared-ui-snackstack": "1.0.0-beta.172",
40
- "@aglyn/shared-ui-theme": "1.0.0-beta.172",
41
- "@aglyn/shared-util-dom": "1.0.0-beta.172",
42
- "@aglyn/shared-util-tools": "1.0.0-beta.172",
43
- "@aglyn/shared-util-vendor": "1.0.0-beta.172",
28
+ "@aglyn/aglyn": "1.0.0-beta.174",
29
+ "@aglyn/aglyn-markdown-editor": "1.0.0-beta.174",
30
+ "@aglyn/aglyn-node-renderer": "1.0.0-beta.174",
31
+ "@aglyn/besigner": "1.0.0-beta.174",
32
+ "@aglyn/shared-data-enums": "1.0.0-beta.174",
33
+ "@aglyn/shared-data-mdi": "1.0.0-beta.174",
34
+ "@aglyn/shared-data-types": "1.0.0-beta.174",
35
+ "@aglyn/shared-svg-icons": "1.0.0-beta.174",
36
+ "@aglyn/shared-ui-json-editor": "1.0.0-beta.174",
37
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.174",
38
+ "@aglyn/shared-ui-jsx-forms": "1.0.0-beta.174",
39
+ "@aglyn/shared-ui-snackstack": "1.0.0-beta.174",
40
+ "@aglyn/shared-ui-theme": "1.0.0-beta.174",
41
+ "@aglyn/shared-util-dom": "1.0.0-beta.174",
42
+ "@aglyn/shared-util-tools": "1.0.0-beta.174",
43
+ "@aglyn/shared-util-vendor": "1.0.0-beta.174",
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
@@ -43,6 +43,8 @@ export * from './lib/contexts/element-drawer-context';
43
43
  export * from './lib/contexts/inspector-extras-context';
44
44
  export * from './lib/contexts/interactions-context';
45
45
  export * from './lib/contexts/layout-chrome-context';
46
+ export * from './lib/contexts/layout-style-selection';
47
+ export * from './lib/components/layout-style-picker.component';
46
48
  export * from './lib/contexts/media-asset-facts-context';
47
49
  export * from './lib/contexts/media-picker-context';
48
50
  export * from './lib/contexts/rendered-canvas-elements';
package/src/besigner.js CHANGED
@@ -42,6 +42,9 @@ export * from "./lib/contexts/element-drawer-context.js";
42
42
  export * from "./lib/contexts/inspector-extras-context.js";
43
43
  export * from "./lib/contexts/interactions-context.js";
44
44
  export * from "./lib/contexts/layout-chrome-context.js";
45
+ // A screen restyling its shared layout's elements for itself (AGL-3286).
46
+ export * from "./lib/contexts/layout-style-selection.js";
47
+ export * from "./lib/components/layout-style-picker.component.js";
45
48
  export * from "./lib/contexts/media-asset-facts-context.js";
46
49
  export * from "./lib/contexts/media-picker-context.js";
47
50
  export * from "./lib/contexts/rendered-canvas-elements.js";
@@ -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'\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,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 * 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"}
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
16
16
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
17
  * See the License for the specific language governing permissions and
18
18
  * limitations under the License.
19
- */ import { canvas } from "@aglyn/aglyn";
19
+ */ import { canvas, NODE_ROOT_ID } from "@aglyn/aglyn";
20
20
  import * as Besigner from "@aglyn/besigner";
21
21
  import { BesignerPanelTabFlag } from "@aglyn/besigner";
22
22
  import { ICON_VARIANT_ELEMENT, ICON_VARIANT_ELEMENT_BROWSE, ICON_VARIANT_ELEMENT_INTERACTIONS, ICON_VARIANT_ELEMENT_PROPERTIES, ICON_VARIANT_ELEMENT_STYLES, ICON_VARIANT_ELEMENT_TREE_VIEW, ICON_VARIANT_MODIFY_ADD } from "@aglyn/shared-data-enums";
@@ -38,6 +38,7 @@ import NodeTreeView from "./node-tree-view.js";
38
38
  import SiteThemeColorTokensProvider from "./site-theme-color-tokens-provider.component.js";
39
39
  import { usePublishActiveHostTheme } from "../utils/active-host-theme.js";
40
40
  import { besignerInspected } from "../contexts/inspected-selection.js";
41
+ import { layoutStyleSelection } from "../contexts/layout-style-selection.js";
41
42
  import { inspectorExtrasFor, useBesignerInspectorExtras } from "../contexts/inspector-extras-context.js";
42
43
  import { besignerDocsUrl } from "../utils/docs-help.js";
43
44
  import WorkspacePanelComponent from "./workspace-panel.component.js";
@@ -137,11 +138,73 @@ const emptyView = /*#__PURE__*/ _jsx(Stack, {
137
138
  });
138
139
  });
139
140
  SelectedNodeHeader.displayName = 'SelectedNodeHeader';
140
- function withLastSelectedNode(WrappedComponent) {
141
+ /**
142
+ * The panel while a shared-layout element is the target (AGL-3286): named in
143
+ * the header like any selection, and marked as the layout's, styles only.
144
+ */ const LayoutElementHeader = ({ selection })=>/*#__PURE__*/ _jsxs(Stack, {
145
+ direction: "row",
146
+ spacing: 1,
147
+ sx: {
148
+ alignItems: 'center',
149
+ px: 2,
150
+ py: 1,
151
+ borderBottom: 1,
152
+ borderColor: 'divider'
153
+ },
154
+ children: [
155
+ /*#__PURE__*/ _jsx(Typography, {
156
+ variant: "subtitle2",
157
+ noWrap: true,
158
+ sx: {
159
+ flex: 1,
160
+ minWidth: 0
161
+ },
162
+ children: `${selection.label} · Layout`
163
+ }),
164
+ /*#__PURE__*/ _jsx(Chip, {
165
+ size: "small",
166
+ variant: "outlined",
167
+ color: "info",
168
+ label: "STYLES ONLY",
169
+ sx: {
170
+ height: 18,
171
+ '& .MuiChip-label': {
172
+ px: 0.75,
173
+ fontSize: 10
174
+ }
175
+ }
176
+ })
177
+ ]
178
+ });
179
+ /** What the Attributes and Interactions tabs say about a layout element. */ const LayoutElementNote = ({ selection })=>/*#__PURE__*/ _jsxs(Stack, {
180
+ spacing: 1.5,
181
+ sx: {
182
+ p: 2
183
+ },
184
+ children: [
185
+ /*#__PURE__*/ _jsx(Typography, {
186
+ variant: "body2",
187
+ color: "text.secondary",
188
+ children: `This element belongs to the shared layout${selection.layoutName ? ` "${selection.layoutName}"` : ''}. Its content is edited in the layout itself — use Edit layout above ` + 'the canvas. On this page you can change how it looks on the Styles tab.'
189
+ }),
190
+ /*#__PURE__*/ _jsx(Button, {
191
+ size: "small",
192
+ variant: "outlined",
193
+ onClick: ()=>layoutStyleSelection.clear(),
194
+ children: 'Back to page elements'
195
+ })
196
+ ]
197
+ });
198
+ function withLastSelectedNode(WrappedComponent, /**
199
+ * What this tab shows while a layout element is the target (AGL-3286):
200
+ * `styles` hands the wrapped Styles form the screen root and the target;
201
+ * `note` says where the element's content is edited.
202
+ */ layoutMode = 'note') {
141
203
  const displayName = getDisplayName(WrappedComponent);
142
204
  const WithLastSelectedNode = observer((props)=>{
143
205
  var _canvas_getNode;
144
206
  const {} = props, rest = _extends({}, props);
207
+ const layoutTarget = layoutStyleSelection.current;
145
208
  const selected = Besigner.focus.getLastSelected();
146
209
  /**
147
210
  * The LIVE node for that selection, re-resolved by id every render
@@ -166,6 +229,25 @@ function withLastSelectedNode(WrappedComponent) {
166
229
  * it) falls back to the stored object, which is exactly today's behaviour
167
230
  * for that case — there is no live node to prefer.
168
231
  */ const lastSelected = selected ? (_canvas_getNode = canvas.getNode(selected.$id)) != null ? _canvas_getNode : selected : selected;
232
+ if (layoutTarget) {
233
+ // The page's layout overrides are kept on the screen root, so that is
234
+ // the node the Styles form is handed; the target says which slice.
235
+ const root = canvas.getNode(NODE_ROOT_ID);
236
+ return /*#__PURE__*/ _jsxs(_Fragment, {
237
+ children: [
238
+ /*#__PURE__*/ _jsx(LayoutElementHeader, {
239
+ selection: layoutTarget
240
+ }),
241
+ layoutMode === 'styles' && root ? /*#__PURE__*/ _jsx(WrappedComponent, _extends({
242
+ node: root
243
+ }, {
244
+ layoutTarget
245
+ }, rest)) : /*#__PURE__*/ _jsx(LayoutElementNote, {
246
+ selection: layoutTarget
247
+ })
248
+ ]
249
+ });
250
+ }
169
251
  return /*#__PURE__*/ _jsx(_Fragment, {
170
252
  children: !lastSelected ? emptyView : /*#__PURE__*/ _jsxs(_Fragment, {
171
253
  children: [
@@ -328,7 +410,7 @@ const panelTabs = {
328
410
  label: 'Styles'
329
411
  },
330
412
  panel: {
331
- Component: withLastSelectedNode(ElementStylesForm)
413
+ Component: withLastSelectedNode(ElementStylesForm, 'styles')
332
414
  }
333
415
  },
334
416
  /*
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/aside-panel.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 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\nimport { canvas } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport {\n type BesignerPanelKey,\n BesignerPanelTabFlag,\n} from '@aglyn/besigner'\nimport {\n ICON_VARIANT_ELEMENT,\n ICON_VARIANT_ELEMENT_BROWSE,\n ICON_VARIANT_ELEMENT_INTERACTIONS,\n ICON_VARIANT_ELEMENT_PROPERTIES,\n ICON_VARIANT_ELEMENT_STYLES,\n ICON_VARIANT_ELEMENT_TREE_VIEW,\n ICON_VARIANT_MODIFY_ADD,\n} from '@aglyn/shared-data-enums'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { mergeSxProps, styled } from '@aglyn/shared-ui-theme'\nimport {\n getDisplayName,\n numberFromHexadecimal,\n numberToHexadecimal,\n} from '@aglyn/shared-util-tools'\nimport { hoistNonReactStatics } from '@aglyn/shared-util-vendor'\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n type TabPanelProps as MuiTabPanelProps,\n} from '@mui/lab'\nimport {\n AppBar as MuiAppBar,\n Box,\n Button,\n Chip,\n Stack,\n Tab as MuiTab,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport {\n type ComponentType,\n forwardRef,\n type SyntheticEvent,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport useAddElementDrawerCallback from '../hooks/use-add-element-drawer-callback'\nimport useAglynBesignerPanel from '../hooks/use-aglyn-besigner-panel'\nimport AccordionListComponent from './accordion-list.component'\nimport ElementInteractionsForm from './element-interactions-form.component'\nimport ComponentAccordionList from './component-accordion-list'\nimport ElementPropsForm from './element-props-form.component'\nimport ElementStylesForm from './element-styles-form.component'\nimport NodeTreeView, { type NodeTreeViewProps } from './node-tree-view'\nimport SiteThemeColorTokensProvider from './site-theme-color-tokens-provider.component'\nimport { usePublishActiveHostTheme } from '../utils/active-host-theme'\nimport { besignerInspected } from '../contexts/inspected-selection'\nimport {\n inspectorExtrasFor,\n useBesignerInspectorExtras,\n} from '../contexts/inspector-extras-context'\nimport { besignerDocsUrl } from '../utils/docs-help'\nimport WorkspacePanelComponent, {\n type WorkspacePanelComponentProps,\n} from './workspace-panel.component'\n\nconst TabPanel = styled(MuiTabPanel, {\n name: 'AglynTabPanel',\n})<MuiTabPanelProps>({\n padding: 0,\n overflow: 'auto',\n height: '100%',\n})\nconst TabPanelInner = styled('div', {\n name: 'AglynTabPanelInner',\n})(({ theme }) => ({\n width: '100%',\n}))\n\nconst emptyView = (\n <Stack\n direction=\"column\"\n component={TabPanelInner}\n sx={{\n justifyContent: 'center',\n height: 1,\n p: 2,\n }}\n >\n <Typography\n color=\"textSecondary\"\n variant=\"overline\"\n component=\"div\"\n align=\"center\"\n >\n <MdiIcon\n sx={{ opacity: 0.3, fontSize: 80 }}\n path={ICON_VARIANT_ELEMENT.path}\n />\n <div>{'Select an element'}</div>\n </Typography>\n </Stack>\n)\n\n\n/**\n * `Hero · Section` with a `SELECTED` tag — the inspector header the\n * `/product` hero mockup shows (AGL-2175).\n *\n * The right panel had no header at all: three tabs of controls with\n * nothing naming what they act on. On a canvas where clicking a child\n * moves the selection under you, that is the difference between editing\n * the section and editing the heading inside it — and the panel looked\n * identical either way.\n *\n * The second half is the COMPONENT, not a category: `labelShort` is the\n * preset's name (`Hero`) and the schema's is what it actually is\n * (`Section`). They are the same word often enough that it is dropped\n * when it would only repeat itself.\n */\nconst SelectedNodeHeader = observer(\n ({ node }: { node: Besigner.LastSelectedNode }) => {\n const name = node?.labelShort ?? ''\n const component = (node as { componentSchema?: { displayName?: string } })\n ?.componentSchema?.displayName\n const subtitle =\n component && component.toLowerCase() !== name.toLowerCase()\n ? `${name} · ${component}`\n : name\n return (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {subtitle || 'Element'}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"secondary\"\n label=\"SELECTED\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n )\n },\n)\nSelectedNodeHeader.displayName = 'SelectedNodeHeader'\n\nfunction withLastSelectedNode<P>(\n WrappedComponent: JSX.ComponentType<P & { node: Besigner.LastSelectedNode }>,\n) {\n const displayName = getDisplayName(WrappedComponent)\n\n const WithLastSelectedNode = observer((props: P) => {\n const { ...rest } = props\n const selected = Besigner.focus.getLastSelected()\n /**\n * The LIVE node for that selection, re-resolved by id every render\n * (AGL-2486).\n *\n * The focus store holds node OBJECTS, not ids. Anything that replaces the\n * canvas map wholesale — `undo`, `redo`, a co-editing `applyNodes`, a\n * local-draft restore — builds fresh node instances and leaves the store\n * pointing at the pre-restore ones. The panels then read their fields from\n * an orphan and, worse, write back through it: `updateNodeProps` assigns\n * `node.props` on an object the canvas no longer owns, so the edit lands\n * nowhere. Nothing throws and nothing marks the document dirty, so an\n * author sees their new text in the box, an unchanged canvas, and `UP TO\n * DATE` — the reported \"the Text attribute silently discards edits\".\n *\n * Resolving here rather than in the three panels because they share this\n * one seam, and it is `observer`-tracked: `getNode` reads the observable\n * map, so a restore re-renders the panel with the live node instead of\n * leaving stale values in the fields.\n *\n * A node the map no longer has (deleted, or a test node that was never in\n * it) falls back to the stored object, which is exactly today's behaviour\n * for that case — there is no live node to prefer.\n */\n const lastSelected = selected\n ? canvas.getNode(selected.$id) ?? selected\n : selected\n\n return (\n <>\n {!lastSelected ? (\n emptyView\n ) : (\n <>\n {/* One header for all three right-panel tabs, so Attributes,\n Styles and Info cannot disagree about what is selected. */}\n <SelectedNodeHeader node={lastSelected} />\n <WrappedComponent node={lastSelected} {...rest} />\n </>\n )}\n </>\n )\n })\n WithLastSelectedNode.displayName = `WithLastSelectedNode(${displayName})`\n hoistNonReactStatics(WithLastSelectedNode, WrappedComponent)\n\n return WithLastSelectedNode\n}\n\nconst withTabPanelInner = (Component: ComponentType<any>) => (props: any) => {\n return (\n <TabPanelInner sx={{ p: 2 }}>\n <Component {...props} />\n </TabPanelInner>\n )\n}\n\n/**\n * The Attributes form with the host app's section beneath it (AGL-2940):\n * whatever `BesignerInspectorExtrasContext` carries, drawn under the\n * selected element's own fields — for that element, when the host supplied\n * a function — and nothing when the host supplied nothing.\n *\n * The selection travels with `editable` (AGL-2908), the same rule the form's\n * own Save as reusable component and Detach actions are drawn under: the\n * canvas root and locked layout chrome answer false. It is read here because\n * a host section has the node and not the editor, and the rule is the drag\n * manager's.\n */\nconst ElementPropsFormWithExtras = (props: any) => {\n const supplied = useBesignerInspectorExtras()\n const inspected = besignerInspected(props.node)\n const extras = inspected ? inspectorExtrasFor(supplied, inspected) : null\n return (\n <>\n <ElementPropsForm {...props} />\n {extras ? <Box sx={{ pt: 2 }}>{extras}</Box> : null}\n </>\n )\n}\n\nconst ElementsTree = forwardRef<any, NodeTreeViewProps>((props, ref) => {\n const handleAddElementClick = useAddElementDrawerCallback()\n return (\n <TabPanelInner sx={{ pl: 0.5 }}>\n <Box\n sx={{\n px: 0.05,\n pb: 1,\n pt: 1,\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <Button\n color=\"primary\"\n startIcon={\n <MdiIcon fontSize=\"inherit\" path={ICON_VARIANT_MODIFY_ADD.path} />\n }\n onClick={() =>\n handleAddElementClick(Besigner.focus.getLastSelected())\n }\n >\n {'Add Element'}\n </Button>\n {/* The hierarchy is the one panel whose rules are not visible in it\n (AGL-2167): which elements accept children, and what dropping on\n an edge does versus dropping in the center. */}\n <HelpTip\n title=\"Drag, drop & hierarchy\"\n excerpt=\"Reparent by dragging here or on the canvas. Containers accept children; dropping on a leaf element makes a sibling instead.\"\n href={besignerDocsUrl('dragDropHierarchy', '#drop-zones-edges-vs-center')}\n sx={{ ml: 'auto', mr: 0.5, fontSize: '0.9em' }}\n />\n </Box>\n <NodeTreeView ref={ref} {...props} />\n </TabPanelInner>\n )\n})\n\nconst panelTabs: Partial<Record<BesignerPanelKey, any>> = {\n panelLeft: {\n defaultTab: BesignerPanelTabFlag.ELEMENTS_TREE,\n panel: {\n id: 'left',\n anchor: 'left',\n 'aria-label': 'left toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENTS_TREE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_TREE_VIEW.path },\n label: 'Hierarchy',\n },\n panel: {\n Component: ElementsTree,\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_BROWSE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_BROWSE.path },\n label: 'Elements',\n },\n panel: {\n Component: ComponentAccordionList,\n },\n },\n ],\n },\n panelRight: {\n // Attributes first and open by default — it is what you reach for on\n // selecting an element. Tab order here is display order only; the flag\n // values are persisted in panel state, so they stay put.\n defaultTab: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n panel: {\n id: 'right',\n anchor: 'right',\n 'aria-label': 'right toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_PROPERTIES.path },\n label: 'Attributes',\n },\n panel: {\n Component: withLastSelectedNode(withTabPanelInner(ElementPropsFormWithExtras)),\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_STYLES,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_STYLES.path },\n label: 'Styles',\n },\n panel: {\n Component: withLastSelectedNode(ElementStylesForm as any),\n },\n },\n /*\n * Interactions, between Styles and where Info used to be.\n *\n * They lived at the bottom of Attributes, under every field the\n * component declares — below the fold on anything with more than a\n * handful, so an author had no reason to believe the element had any.\n * An interaction is not an attribute: it is a behaviour, authored in a\n * dialog rather than a field, and it belongs beside the styles as a\n * peer.\n *\n * INFO IS GONE. Its two accordions are reference detail about the\n * component and the node's ids — worth having, not worth a tab — and\n * they now sit at the bottom of Attributes, beside the fields they\n * describe. Its flag value stays reserved; panel state is persisted,\n * and a reader whose last session ended on Info would otherwise return\n * to a tab id that means something else.\n */\n {\n value: BesignerPanelTabFlag.ELEMENT_INTERACTIONS,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_INTERACTIONS.path },\n label: 'Interactions',\n },\n panel: {\n Component: withLastSelectedNode(\n withTabPanelInner(ElementInteractionsForm as any),\n ),\n },\n },\n ],\n },\n}\n\nexport interface AsidePanelComponentProps extends WorkspacePanelComponentProps {\n panel: BesignerPanelKey\n}\n\nexport const AsidePanelComponent = forwardRef<any, AsidePanelComponentProps>(\n (props, ref) => {\n const { children, panel: panelKey, ...rest } = props\n\n // Republish the page's site theme for surfaces that render OUTSIDE the\n // page tree (AGL-2486). This panel is inside `HostThemeDocumentContext`;\n // the Choose-element dialog — rendered by `withBesignerContext`, which\n // wraps the page — is not, and its element preview was painting the\n // console's brand onto someone else's site.\n usePublishActiveHostTheme()\n\n const [panel, setPanel] = useAglynBesignerPanel(panelKey)\n const {\n panel: { id, ...panelProps },\n defaultTab,\n tabs,\n } = panelTabs[panelKey]\n const { toggled, tab, size } = panel || {}\n const value = tab || defaultTab\n\n // The bottom-right corner belongs to this panel while it is open\n // (AGL-2486), so publish how far a viewport-fixed affordance has to\n // stand off to clear it. The Assist launcher reads this; the console's\n // own chrome leaves the corner free and never sets it, which is why the\n // variable carries the offset rather than the panel width — an unset\n // variable then means \"the corner is yours\" everywhere else.\n //\n // Kept in an effect on the LIVE panel state so it tracks the author\n // dragging the panel wider or collapsing it, and removed on unmount:\n // navigating from the besigner back into the console must not leave a\n // 395px inset behind on a page with no panel at all.\n // `size` is `string | number` on the panel state, so a numeric width is\n // parsed rather than added to: `'375' + 20` is `'37520'`, which is a\n // perfectly valid CSS length and would park the launcher off-screen.\n const panelWidth = Number.parseFloat(String(size ?? ''))\n const rightInset =\n panelKey === 'panelRight' && toggled && Number.isFinite(panelWidth)\n ? panelWidth + 20\n : null\n useEffect(() => {\n if (panelKey !== 'panelRight') return undefined\n const root = document.documentElement\n const property = '--aglyn-assist-inset-right'\n if (rightInset === null) {\n root.style.removeProperty(property)\n } else {\n root.style.setProperty(property, `${rightInset}px`)\n }\n return () => {\n root.style.removeProperty(property)\n }\n }, [panelKey, rightInset])\n\n const handleTabChange = useCallback(\n (e: SyntheticEvent, val: string) => {\n setPanel((panel) => ({ ...panel, tab: numberFromHexadecimal(val) }))\n },\n [setPanel],\n )\n\n return (\n <WorkspacePanelComponent\n ref={ref}\n id={`aglyn:panel-${id}`}\n aria-label=\"left toolbox panel\"\n size={size}\n open={toggled}\n component=\"aside\"\n {...panelProps}\n {...rest}\n >\n <MuiTabContext value={numberToHexadecimal(value)}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <MuiAppBar\n color=\"surface\"\n position=\"relative\"\n elevation={0}\n enableColorOnDark\n >\n <MuiTabList\n onChange={handleTabChange}\n variant=\"fullWidth\"\n sx={{\n '& .MuiTab-root': {\n '&.Mui-selected': {\n // Use sx string shorthands instead of palette callbacks so the\n // sx system resolves them via theme.vars (CSS custom-property refs)\n // rather than the static light-mode palette values.\n color: 'text.primary',\n backgroundColor: 'background.paper',\n },\n },\n '& .MuiTabs-indicator': {\n top: 0,\n backgroundColor: 'secondary.main',\n },\n }}\n >\n {tabs.map(({ value, tab: { icon, ...tab } }) => (\n <MuiTab\n key={value}\n // color={'tertiary'}\n value={numberToHexadecimal(value)}\n iconPosition=\"top\"\n icon={<MdiIcon {...icon} fontSize=\"small\" />}\n sx={{\n minHeight: 'unset',\n fontSize: (theme) => theme.typography.pxToRem(12),\n lineHeight: 0.8,\n pt: 1,\n }}\n {...tab}\n />\n ))}\n </MuiTabList>\n </MuiAppBar>\n </Box>\n\n {/* Site-theme color tokens (AGL-588): every COLOR_PICKER field\n in these panels — styles panel, attribute forms, email\n blocks — offers the site palette's token references. */}\n <SiteThemeColorTokensProvider>\n {tabs.map(({ value, panel: { Component, ...panel } }) => (\n <TabPanel\n key={value}\n value={numberToHexadecimal(value)}\n {...panel}\n >\n <Component />\n </TabPanel>\n ))}\n </SiteThemeColorTokensProvider>\n </MuiTabContext>\n\n {children}\n </WorkspacePanelComponent>\n )\n },\n)\n\nAsidePanelComponent.displayName = 'AsidePanelComponent'\nAsidePanelComponent.aglyn = true\n\nexport default AsidePanelComponent\n"],"names":["canvas","Besigner","BesignerPanelTabFlag","ICON_VARIANT_ELEMENT","ICON_VARIANT_ELEMENT_BROWSE","ICON_VARIANT_ELEMENT_INTERACTIONS","ICON_VARIANT_ELEMENT_PROPERTIES","ICON_VARIANT_ELEMENT_STYLES","ICON_VARIANT_ELEMENT_TREE_VIEW","ICON_VARIANT_MODIFY_ADD","HelpTip","MdiIcon","styled","getDisplayName","numberFromHexadecimal","numberToHexadecimal","hoistNonReactStatics","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","AppBar","MuiAppBar","Box","Button","Chip","Stack","Tab","MuiTab","Typography","observer","forwardRef","useCallback","useEffect","useAddElementDrawerCallback","useAglynBesignerPanel","ElementInteractionsForm","ComponentAccordionList","ElementPropsForm","ElementStylesForm","NodeTreeView","SiteThemeColorTokensProvider","usePublishActiveHostTheme","besignerInspected","inspectorExtrasFor","useBesignerInspectorExtras","besignerDocsUrl","WorkspacePanelComponent","name","padding","overflow","height","TabPanelInner","theme","width","emptyView","direction","component","sx","justifyContent","p","color","variant","align","opacity","fontSize","path","div","SelectedNodeHeader","node","labelShort","componentSchema","displayName","subtitle","toLowerCase","spacing","alignItems","px","py","borderBottom","borderColor","noWrap","flex","minWidth","size","label","withLastSelectedNode","WrappedComponent","WithLastSelectedNode","props","rest","selected","focus","getLastSelected","lastSelected","getNode","$id","withTabPanelInner","Component","ElementPropsFormWithExtras","supplied","inspected","extras","pt","ElementsTree","ref","handleAddElementClick","pl","pb","display","startIcon","onClick","title","excerpt","href","ml","mr","panelTabs","panelLeft","defaultTab","ELEMENTS_TREE","panel","id","anchor","tabs","value","tab","icon","ELEMENT_BROWSE","panelRight","ELEMENT_PROPS_FORM","ELEMENT_STYLES","ELEMENT_INTERACTIONS","AsidePanelComponent","children","panelKey","setPanel","panelProps","toggled","panelWidth","Number","parseFloat","String","rightInset","isFinite","undefined","root","document","documentElement","property","style","removeProperty","setProperty","handleTabChange","e","val","aria-label","open","position","elevation","enableColorOnDark","onChange","backgroundCol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AAEvC,KAAK,EAAEC,SAAAA,EAAuB,OAAlB,EAAEC,IAAI,EAAU,SAALD;;;yDAClC,KAAClG;wCAEC,qBAAqB;wCACrBiG,OAAOhH,oBAAoBgH;wCAC3BwC,cAAa;wCACbtC,oBAAM,KAACtH,sBAAYsH;4CAAM9D,UAAS;;wCAClCP,IAAI;4CACF4G,WAAW;4CACXrG,UAAU,CAACZ,QAAUA,MAAMkH,UAAU,CAACC,OAAO,CAAC;4CAC9CC,YAAY;4CACZlE,IAAI;wCACN;uCACIuB,MAXCD;;;;;kCAqBf,KAACpF;kCACEmF,KAAKwC,GAAG,CAAC;gCAAC,EAAEvC,KAAK,EAAEJ,WAAAA,EAAgC,OAAzB,EAAEvB,SAAS,EAAY,SAAPuB;;;iDACzC,KAACtG;gCAEC0G,OAAOhH,oBAAoBgH;+BACvBJ;0CAEJ,cAAA,KAACvB;gCAJI2B;;;;;YAUZS;;;AAGP,GACD;AAEDD,oBAAoB7D,WAAW,GAAG;AAClC6D,oBAAoBqC,KAAK,GAAG;AAE5B,eAAerC,oBAAmB"}
1
+ {"version":3,"sources":["../../../../../../../../libs/besigner/feature/designer/src/lib/components/aside-panel.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 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\nimport { canvas, NODE_ROOT_ID } from '@aglyn/aglyn'\nimport * as Besigner from '@aglyn/besigner'\nimport {\n type BesignerPanelKey,\n BesignerPanelTabFlag,\n} from '@aglyn/besigner'\nimport {\n ICON_VARIANT_ELEMENT,\n ICON_VARIANT_ELEMENT_BROWSE,\n ICON_VARIANT_ELEMENT_INTERACTIONS,\n ICON_VARIANT_ELEMENT_PROPERTIES,\n ICON_VARIANT_ELEMENT_STYLES,\n ICON_VARIANT_ELEMENT_TREE_VIEW,\n ICON_VARIANT_MODIFY_ADD,\n} from '@aglyn/shared-data-enums'\nimport { HelpTip, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { mergeSxProps, styled } from '@aglyn/shared-ui-theme'\nimport {\n getDisplayName,\n numberFromHexadecimal,\n numberToHexadecimal,\n} from '@aglyn/shared-util-tools'\nimport { hoistNonReactStatics } from '@aglyn/shared-util-vendor'\nimport {\n TabContext as MuiTabContext,\n TabList as MuiTabList,\n TabPanel as MuiTabPanel,\n type TabPanelProps as MuiTabPanelProps,\n} from '@mui/lab'\nimport {\n AppBar as MuiAppBar,\n Box,\n Button,\n Chip,\n Stack,\n Tab as MuiTab,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react-lite'\nimport {\n type ComponentType,\n forwardRef,\n type SyntheticEvent,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react'\nimport useAddElementDrawerCallback from '../hooks/use-add-element-drawer-callback'\nimport useAglynBesignerPanel from '../hooks/use-aglyn-besigner-panel'\nimport AccordionListComponent from './accordion-list.component'\nimport ElementInteractionsForm from './element-interactions-form.component'\nimport ComponentAccordionList from './component-accordion-list'\nimport ElementPropsForm from './element-props-form.component'\nimport ElementStylesForm from './element-styles-form.component'\nimport NodeTreeView, { type NodeTreeViewProps } from './node-tree-view'\nimport SiteThemeColorTokensProvider from './site-theme-color-tokens-provider.component'\nimport { usePublishActiveHostTheme } from '../utils/active-host-theme'\nimport { besignerInspected } from '../contexts/inspected-selection'\nimport {\n type LayoutElementSelection,\n layoutStyleSelection,\n} from '../contexts/layout-style-selection'\nimport {\n inspectorExtrasFor,\n useBesignerInspectorExtras,\n} from '../contexts/inspector-extras-context'\nimport { besignerDocsUrl } from '../utils/docs-help'\nimport WorkspacePanelComponent, {\n type WorkspacePanelComponentProps,\n} from './workspace-panel.component'\n\nconst TabPanel = styled(MuiTabPanel, {\n name: 'AglynTabPanel',\n})<MuiTabPanelProps>({\n padding: 0,\n overflow: 'auto',\n height: '100%',\n})\nconst TabPanelInner = styled('div', {\n name: 'AglynTabPanelInner',\n})(({ theme }) => ({\n width: '100%',\n}))\n\nconst emptyView = (\n <Stack\n direction=\"column\"\n component={TabPanelInner}\n sx={{\n justifyContent: 'center',\n height: 1,\n p: 2,\n }}\n >\n <Typography\n color=\"textSecondary\"\n variant=\"overline\"\n component=\"div\"\n align=\"center\"\n >\n <MdiIcon\n sx={{ opacity: 0.3, fontSize: 80 }}\n path={ICON_VARIANT_ELEMENT.path}\n />\n <div>{'Select an element'}</div>\n </Typography>\n </Stack>\n)\n\n\n/**\n * `Hero · Section` with a `SELECTED` tag — the inspector header the\n * `/product` hero mockup shows (AGL-2175).\n *\n * The right panel had no header at all: three tabs of controls with\n * nothing naming what they act on. On a canvas where clicking a child\n * moves the selection under you, that is the difference between editing\n * the section and editing the heading inside it — and the panel looked\n * identical either way.\n *\n * The second half is the COMPONENT, not a category: `labelShort` is the\n * preset's name (`Hero`) and the schema's is what it actually is\n * (`Section`). They are the same word often enough that it is dropped\n * when it would only repeat itself.\n */\nconst SelectedNodeHeader = observer(\n ({ node }: { node: Besigner.LastSelectedNode }) => {\n const name = node?.labelShort ?? ''\n const component = (node as { componentSchema?: { displayName?: string } })\n ?.componentSchema?.displayName\n const subtitle =\n component && component.toLowerCase() !== name.toLowerCase()\n ? `${name} · ${component}`\n : name\n return (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {subtitle || 'Element'}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"secondary\"\n label=\"SELECTED\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n )\n },\n)\nSelectedNodeHeader.displayName = 'SelectedNodeHeader'\n\n/**\n * The panel while a shared-layout element is the target (AGL-3286): named in\n * the header like any selection, and marked as the layout's, styles only.\n */\nconst LayoutElementHeader = ({\n selection,\n}: {\n selection: LayoutElementSelection\n}) => (\n <Stack\n direction=\"row\"\n spacing={1}\n sx={{\n alignItems: 'center',\n px: 2,\n py: 1,\n borderBottom: 1,\n borderColor: 'divider',\n }}\n >\n <Typography variant=\"subtitle2\" noWrap sx={{ flex: 1, minWidth: 0 }}>\n {`${selection.label} · Layout`}\n </Typography>\n <Chip\n size=\"small\"\n variant=\"outlined\"\n color=\"info\"\n label=\"STYLES ONLY\"\n sx={{ height: 18, '& .MuiChip-label': { px: 0.75, fontSize: 10 } }}\n />\n </Stack>\n)\n\n/** What the Attributes and Interactions tabs say about a layout element. */\nconst LayoutElementNote = ({\n selection,\n}: {\n selection: LayoutElementSelection\n}) => (\n <Stack spacing={1.5} sx={{ p: 2 }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`This element belongs to the shared layout${\n selection.layoutName ? ` \"${selection.layoutName}\"` : ''\n }. Its content is edited in the layout itself — use Edit layout above ` +\n 'the canvas. On this page you can change how it looks on the Styles tab.'}\n </Typography>\n <Button\n size=\"small\"\n variant=\"outlined\"\n onClick={() => layoutStyleSelection.clear()}\n >\n {'Back to page elements'}\n </Button>\n </Stack>\n)\n\nfunction withLastSelectedNode<P>(\n WrappedComponent: JSX.ComponentType<P & { node: Besigner.LastSelectedNode }>,\n /**\n * What this tab shows while a layout element is the target (AGL-3286):\n * `styles` hands the wrapped Styles form the screen root and the target;\n * `note` says where the element's content is edited.\n */\n layoutMode: 'styles' | 'note' = 'note',\n) {\n const displayName = getDisplayName(WrappedComponent)\n\n const WithLastSelectedNode = observer((props: P) => {\n const { ...rest } = props\n const layoutTarget = layoutStyleSelection.current\n const selected = Besigner.focus.getLastSelected()\n /**\n * The LIVE node for that selection, re-resolved by id every render\n * (AGL-2486).\n *\n * The focus store holds node OBJECTS, not ids. Anything that replaces the\n * canvas map wholesale — `undo`, `redo`, a co-editing `applyNodes`, a\n * local-draft restore — builds fresh node instances and leaves the store\n * pointing at the pre-restore ones. The panels then read their fields from\n * an orphan and, worse, write back through it: `updateNodeProps` assigns\n * `node.props` on an object the canvas no longer owns, so the edit lands\n * nowhere. Nothing throws and nothing marks the document dirty, so an\n * author sees their new text in the box, an unchanged canvas, and `UP TO\n * DATE` — the reported \"the Text attribute silently discards edits\".\n *\n * Resolving here rather than in the three panels because they share this\n * one seam, and it is `observer`-tracked: `getNode` reads the observable\n * map, so a restore re-renders the panel with the live node instead of\n * leaving stale values in the fields.\n *\n * A node the map no longer has (deleted, or a test node that was never in\n * it) falls back to the stored object, which is exactly today's behaviour\n * for that case — there is no live node to prefer.\n */\n const lastSelected = selected\n ? canvas.getNode(selected.$id) ?? selected\n : selected\n\n if (layoutTarget) {\n // The page's layout overrides are kept on the screen root, so that is\n // the node the Styles form is handed; the target says which slice.\n const root = canvas.getNode(NODE_ROOT_ID)\n return (\n <>\n <LayoutElementHeader selection={layoutTarget} />\n {layoutMode === 'styles' && root ? (\n <WrappedComponent\n node={root}\n {...({ layoutTarget } as any)}\n {...rest}\n />\n ) : (\n <LayoutElementNote selection={layoutTarget} />\n )}\n </>\n )\n }\n\n return (\n <>\n {!lastSelected ? (\n emptyView\n ) : (\n <>\n {/* One header for all three right-panel tabs, so Attributes,\n Styles and Info cannot disagree about what is selected. */}\n <SelectedNodeHeader node={lastSelected} />\n <WrappedComponent node={lastSelected} {...rest} />\n </>\n )}\n </>\n )\n })\n WithLastSelectedNode.displayName = `WithLastSelectedNode(${displayName})`\n hoistNonReactStatics(WithLastSelectedNode, WrappedComponent)\n\n return WithLastSelectedNode\n}\n\nconst withTabPanelInner = (Component: ComponentType<any>) => (props: any) => {\n return (\n <TabPanelInner sx={{ p: 2 }}>\n <Component {...props} />\n </TabPanelInner>\n )\n}\n\n/**\n * The Attributes form with the host app's section beneath it (AGL-2940):\n * whatever `BesignerInspectorExtrasContext` carries, drawn under the\n * selected element's own fields — for that element, when the host supplied\n * a function — and nothing when the host supplied nothing.\n *\n * The selection travels with `editable` (AGL-2908), the same rule the form's\n * own Save as reusable component and Detach actions are drawn under: the\n * canvas root and locked layout chrome answer false. It is read here because\n * a host section has the node and not the editor, and the rule is the drag\n * manager's.\n */\nconst ElementPropsFormWithExtras = (props: any) => {\n const supplied = useBesignerInspectorExtras()\n const inspected = besignerInspected(props.node)\n const extras = inspected ? inspectorExtrasFor(supplied, inspected) : null\n return (\n <>\n <ElementPropsForm {...props} />\n {extras ? <Box sx={{ pt: 2 }}>{extras}</Box> : null}\n </>\n )\n}\n\nconst ElementsTree = forwardRef<any, NodeTreeViewProps>((props, ref) => {\n const handleAddElementClick = useAddElementDrawerCallback()\n return (\n <TabPanelInner sx={{ pl: 0.5 }}>\n <Box\n sx={{\n px: 0.05,\n pb: 1,\n pt: 1,\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <Button\n color=\"primary\"\n startIcon={\n <MdiIcon fontSize=\"inherit\" path={ICON_VARIANT_MODIFY_ADD.path} />\n }\n onClick={() =>\n handleAddElementClick(Besigner.focus.getLastSelected())\n }\n >\n {'Add Element'}\n </Button>\n {/* The hierarchy is the one panel whose rules are not visible in it\n (AGL-2167): which elements accept children, and what dropping on\n an edge does versus dropping in the center. */}\n <HelpTip\n title=\"Drag, drop & hierarchy\"\n excerpt=\"Reparent by dragging here or on the canvas. Containers accept children; dropping on a leaf element makes a sibling instead.\"\n href={besignerDocsUrl('dragDropHierarchy', '#drop-zones-edges-vs-center')}\n sx={{ ml: 'auto', mr: 0.5, fontSize: '0.9em' }}\n />\n </Box>\n <NodeTreeView ref={ref} {...props} />\n </TabPanelInner>\n )\n})\n\nconst panelTabs: Partial<Record<BesignerPanelKey, any>> = {\n panelLeft: {\n defaultTab: BesignerPanelTabFlag.ELEMENTS_TREE,\n panel: {\n id: 'left',\n anchor: 'left',\n 'aria-label': 'left toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENTS_TREE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_TREE_VIEW.path },\n label: 'Hierarchy',\n },\n panel: {\n Component: ElementsTree,\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_BROWSE,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_BROWSE.path },\n label: 'Elements',\n },\n panel: {\n Component: ComponentAccordionList,\n },\n },\n ],\n },\n panelRight: {\n // Attributes first and open by default — it is what you reach for on\n // selecting an element. Tab order here is display order only; the flag\n // values are persisted in panel state, so they stay put.\n defaultTab: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n panel: {\n id: 'right',\n anchor: 'right',\n 'aria-label': 'right toolbox panel',\n },\n tabs: [\n {\n value: BesignerPanelTabFlag.ELEMENT_PROPS_FORM,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_PROPERTIES.path },\n label: 'Attributes',\n },\n panel: {\n Component: withLastSelectedNode(withTabPanelInner(ElementPropsFormWithExtras)),\n },\n },\n {\n value: BesignerPanelTabFlag.ELEMENT_STYLES,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_STYLES.path },\n label: 'Styles',\n },\n panel: {\n Component: withLastSelectedNode(ElementStylesForm as any, 'styles'),\n },\n },\n /*\n * Interactions, between Styles and where Info used to be.\n *\n * They lived at the bottom of Attributes, under every field the\n * component declares — below the fold on anything with more than a\n * handful, so an author had no reason to believe the element had any.\n * An interaction is not an attribute: it is a behaviour, authored in a\n * dialog rather than a field, and it belongs beside the styles as a\n * peer.\n *\n * INFO IS GONE. Its two accordions are reference detail about the\n * component and the node's ids — worth having, not worth a tab — and\n * they now sit at the bottom of Attributes, beside the fields they\n * describe. Its flag value stays reserved; panel state is persisted,\n * and a reader whose last session ended on Info would otherwise return\n * to a tab id that means something else.\n */\n {\n value: BesignerPanelTabFlag.ELEMENT_INTERACTIONS,\n tab: {\n icon: { path: ICON_VARIANT_ELEMENT_INTERACTIONS.path },\n label: 'Interactions',\n },\n panel: {\n Component: withLastSelectedNode(\n withTabPanelInner(ElementInteractionsForm as any),\n ),\n },\n },\n ],\n },\n}\n\nexport interface AsidePanelComponentProps extends WorkspacePanelComponentProps {\n panel: BesignerPanelKey\n}\n\nexport const AsidePanelComponent = forwardRef<any, AsidePanelComponentProps>(\n (props, ref) => {\n const { children, panel: panelKey, ...rest } = props\n\n // Republish the page's site theme for surfaces that render OUTSIDE the\n // page tree (AGL-2486). This panel is inside `HostThemeDocumentContext`;\n // the Choose-element dialog — rendered by `withBesignerContext`, which\n // wraps the page — is not, and its element preview was painting the\n // console's brand onto someone else's site.\n usePublishActiveHostTheme()\n\n const [panel, setPanel] = useAglynBesignerPanel(panelKey)\n const {\n panel: { id, ...panelProps },\n defaultTab,\n tabs,\n } = panelTabs[panelKey]\n const { toggled, tab, size } = panel || {}\n const value = tab || defaultTab\n\n // The bottom-right corner belongs to this panel while it is open\n // (AGL-2486), so publish how far a viewport-fixed affordance has to\n // stand off to clear it. The Assist launcher reads this; the console's\n // own chrome leaves the corner free and never sets it, which is why the\n // variable carries the offset rather than the panel width — an unset\n // variable then means \"the corner is yours\" everywhere else.\n //\n // Kept in an effect on the LIVE panel state so it tracks the author\n // dragging the panel wider or collapsing it, and removed on unmount:\n // navigating from the besigner back into the console must not leave a\n // 395px inset behind on a page with no panel at all.\n // `size` is `string | number` on the panel state, so a numeric width is\n // parsed rather than added to: `'375' + 20` is `'37520'`, which is a\n // perfectly valid CSS length and would park the launcher off-screen.\n const panelWidth = Number.parseFloat(String(size ?? ''))\n const rightInset =\n panelKey === 'panelRight' && toggled && Number.isFinite(panelWidth)\n ? panelWidth + 20\n : null\n useEffect(() => {\n if (panelKey !== 'panelRight') return undefined\n const root = document.documentElement\n const property = '--aglyn-assist-inset-right'\n if (rightInset === null) {\n root.style.removeProperty(property)\n } else {\n root.style.setProperty(property, `${rightInset}px`)\n }\n return () => {\n root.style.removeProperty(property)\n }\n }, [panelKey, rightInset])\n\n const handleTabChange = useCallback(\n (e: SyntheticEvent, val: string) => {\n setPanel((panel) => ({ ...panel, tab: numberFromHexadecimal(val) }))\n },\n [setPanel],\n )\n\n return (\n <WorkspacePanelComponent\n ref={ref}\n id={`aglyn:panel-${id}`}\n aria-label=\"left toolbox panel\"\n size={size}\n open={toggled}\n component=\"aside\"\n {...panelProps}\n {...rest}\n >\n <MuiTabContext value={numberToHexadecimal(value)}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <MuiAppBar\n color=\"surface\"\n position=\"relative\"\n elevation={0}\n enableColorOnDark\n >\n <MuiTabList\n onChange={handleTabChange}\n variant=\"fullWidth\"\n sx={{\n '& .MuiTab-root': {\n '&.Mui-selected': {\n // Use sx string shorthands instead of palette callbacks so the\n // sx system resolves them via theme.vars (CSS custom-property refs)\n // rather than the static light-mode palette values.\n color: 'text.primary',\n backgroundColor: 'background.paper',\n },\n },\n '& .MuiTabs-indicator': {\n top: 0,\n backgroundColor: 'secondary.main',\n },\n }}\n >\n {tabs.map(({ value, tab: { icon, ...tab } }) => (\n <MuiTab\n key={value}\n // color={'tertiary'}\n value={numberToHexadecimal(value)}\n iconPosition=\"top\"\n icon={<MdiIcon {...icon} fontSize=\"small\" />}\n sx={{\n minHeight: 'unset',\n fontSize: (theme) => theme.typography.pxToRem(12),\n lineHeight: 0.8,\n pt: 1,\n }}\n {...tab}\n />\n ))}\n </MuiTabList>\n </MuiAppBar>\n </Box>\n\n {/* Site-theme color tokens (AGL-588): every COLOR_PICKER field\n in these panels — styles panel, attribute forms, email\n blocks — offers the site palette's token references. */}\n <SiteThemeColorTokensProvider>\n {tabs.map(({ value, panel: { Component, ...panel } }) => (\n <TabPanel\n key={value}\n value={numberToHexadecimal(value)}\n {...panel}\n >\n <Component />\n </TabPanel>\n ))}\n </SiteThemeColorTokensProvider>\n </MuiTabContext>\n\n {children}\n </WorkspacePanelComponent>\n )\n },\n)\n\nAsidePanelComponent.displayName = 'AsidePanelComponent'\nAsidePanelComponent.aglyn = true\n\nexport default AsidePanelComponent\n"],"names":["canvas","NODE_ROOT_ID","Besigner","BesignerPanelTabFlag","ICON_VARIANT_ELEMENT","ICON_VARIANT_ELEMENT_BROWSE","ICON_VARIANT_ELEMENT_INTERACTIONS","ICON_VARIANT_ELEMENT_PROPERTIES","ICON_VARIANT_ELEMENT_STYLES","ICON_VARIANT_ELEMENT_TREE_VIEW","ICON_VARIANT_MODIFY_ADD","HelpTip","MdiIcon","styled","getDisplayName","numberFromHexadecimal","numberToHexadecimal","hoistNonReactStatics","TabContext","MuiTabContext","TabList","MuiTabList","TabPanel","MuiTabPanel","AppBar","MuiAppBar","Box","Button","Chip","Stack","Tab","MuiTab","Typography","observer","forwardRef","useCallback","useEffect","useAddElementDrawerCallback","useAglynBesignerPanel","ElementInteractionsForm","ComponentAccordionList","ElementPropsForm","ElementStylesForm","NodeTreeView","SiteThemeColorTokensProvider","usePublishActiveHostTheme","besignerInspected","layoutStyleSelection","inspectorExtrasFor","useBesignerInspectorExtras","besignerDocsUrl","WorkspacePanelComponent","name","padding","overflow","height","TabPanelInner","theme","width","emptyView","direction","component","sx","justifyContent","p","color","variant","align","opacity","fontSize","path","div","SelectedNodeHeader","node","labelShort","componentSchema","displayName","subtitle","toLowerCase","spacing","alignItems","px","py","borderBottom","borderColor","noWrap","flex","minWidth","size","label","LayoutElementHeader","selection","LayoutElementNote","layoutName","onClick","clear","withLastSelectedNode","WrappedComponent","layoutMode","WithLastSelectedNode","props","rest","layoutTarget","current","selected","focus","getLastSelected","lastSelected","getNode","$id","root","withTabPanelInner","Component","ElementPropsFormWithExtras","supplied","inspected","extras","pt","ElementsTree","ref","handleAddElementClick","pl","pb","display","startIcon","title","excerpt","href","ml","mr","panelTabs","panelLeft","defaultTab","ELEMENTS_TREE","panel","id","anchor","tabs","value","tab","icon","ELEMENT_BROWSE","panelRight","ELEMENT_PROPS_FORM","ELEMENT_STYLES","ELEMENT_INTERACTIONS","AsidePanelComponent","children","panelKey","setPanel","panelProps","toggled","panelWidth","Number","parseFloat","String","rightInset","isFinite","undefined","document","documentElement","property","style","removeProperty","setProperty","handleTabChange","e","val","aria-label","open","position","elevation","enableColorOnDark","onChange","backgroundColor","top","map","iconPosition","minHeight","typography","pxToRem","lineHeight","aglyn"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,SAASA,MAAM,EAAEC,YAAY,QAAQ,eAAc;AACnD,YAAYC,cAAc,kBAAiB;AAC3C,SAEEC,oBAAoB,QACf,kBAAiB;AACxB,SACEC,oBAAoB,EACpBC,2BAA2B,EAC3BC,iCAAiC,EACjCC,+BAA+B,EAC/BC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,uBAAuB,QAClB,2BAA0B;AACjC,SAASC,OAAO,EAAEC,OAAO,QAAQ,uBAAsB;AACvD,SAAuBC,MAAM,QAAQ,yBAAwB;AAC7D,SACEC,cAAc,EACdC,qBAAqB,EACrBC,mBAAmB,QACd,2BAA0B;AACjC,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SACEC,cAAcC,aAAa,EAC3BC,WAAWC,UAAU,EACrBC,YAAYC,WAAW,QAElB,WAAU;AACjB,SACEC,UAAUC,SAAS,EACnBC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,KAAK,EACLC,OAAOC,MAAM,EACbC,UAAU,QACL,gBAAe;AACtB,SAASC,QAAQ,QAAQ,kBAAiB;AAC1C,SAEEC,UAAU,EAEVC,WAAW,EACXC,SAAS,QAGJ,QAAO;AACd,OAAOC,iCAAiC,8CAA0C;AAClF,OAAOC,2BAA2B,uCAAmC;AAErE,OAAOC,6BAA6B,2CAAuC;AAC3E,OAAOC,4BAA4B,gCAA4B;AAC/D,OAAOC,sBAAsB,oCAAgC;AAC7D,OAAOC,uBAAuB,qCAAiC;AAC/D,OAAOC,kBAA8C,sBAAkB;AACvE,OAAOC,kCAAkC,kDAA8C;AACvF,SAASC,yBAAyB,QAAQ,gCAA4B;AACtE,SAASC,iBAAiB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,kBAAkB;wCAChB,kBAAkB;4CAChB,+DAA+D;4CAC/D,oEAAoE;4CACpE,oDAAoD;4CACpDG,OAAO;4CACP6G,iBAAiB;wCACnB;oCACF;oCACA,wBAAwB;wCACtBC,KAAK;wCACLD,iBAAiB;oCACnB;gCACF;0CAECrC,KAAKuC,GAAG,CAAC;wCAAC,EAAEtC,KAAK,EAAEC,SAAAA,EAAuB,OAAlB,EAAEC,IAAI,EAAU,SAALD;;;yDAClC,KAAC5G;wCAEC,qBAAqB;wCACrB2G,OAAO1H,oBAAoB0H;wCAC3BuC,cAAa;wCACbrC,oBAAM,KAAChI,sBAAYgI;4CAAMvE,UAAS;;wCAClCP,IAAI;4CACFoH,WAAW;4CACX7G,UAAU,CAACZ,QAAUA,MAAM0H,UAAU,CAACC,OAAO,CAAC;4CAC9CC,YAAY;4CACZhE,IAAI;wCACN;uCACIsB,MAXCD;;;;;kCAqBf,KAAC9F;kCACE6F,KAAKuC,GAAG,CAAC;gCAAC,EAAEtC,KAAK,EAAEJ,WAAAA,EAAgC,OAAzB,EAAEtB,SAAS,EAAY,SAAPsB;;;iDACzC,KAAChH;gCAECoH,OAAO1H,oBAAoB0H;+BACvBJ;0CAEJ,cAAA,KAACtB;gCAJI0B;;;;;YAUZS;;;AAGP,GACD;AAEDD,oBAAoBtE,WAAW,GAAG;AAClCsE,oBAAoBoC,KAAK,GAAG;AAE5B,eAAepC,oBAAmB"}
@@ -101,6 +101,11 @@ export interface CustomCssFormProps {
101
101
  * plain node; defaults to the component root.
102
102
  */
103
103
  overrideKey?: string;
104
+ /**
105
+ * True when the node is a placed form whose design resolves, so its edits
106
+ * land in the same override slice the Styles panel writes (AGL-3285).
107
+ */
108
+ placedFormResolves?: boolean;
104
109
  }
105
110
  /**
106
111
  * Custom CSS for the selected element's `sx` (AGL-332): a friendly
@@ -280,13 +280,16 @@ const draftKey = (nodeId, overrideKey, mode)=>[
280
280
  * nested selectors) verbatim.
281
281
  */ export const CustomCssForm = observer((props)=>{
282
282
  var _target_sx, _ref, _ref1;
283
- const { node, breakpoint, overrideKey } = props;
283
+ const { node, breakpoint, overrideKey, placedFormResolves } = props;
284
284
  // Same target the rest of the Styles panel writes (AGL-1306/1332): a
285
285
  // plain node's own sx, or the instance override slice the panel's style
286
286
  // target names — root, or one leaf inside the component.
287
- const target = useMemo(()=>getNodeStyleTarget(node, overrideKey), [
287
+ const target = useMemo(()=>getNodeStyleTarget(node, overrideKey, {
288
+ placedFormResolves
289
+ }), [
288
290
  node,
289
- overrideKey
291
+ overrideKey,
292
+ placedFormResolves
290
293
  ]);
291
294
  const nodeSx = (_target_sx = target.sx) != null ? _target_sx : {};
292
295
  const [mode, setMode] = useState('builder');