@next-buildr/editor 2.0.1 → 3.0.0-rc.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/README.md +2 -0
- package/UPGRADING.md +322 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/app/builder-editor.test.js +223 -18
- package/dist/app/config.d.ts +27 -4
- package/dist/app/config.d.ts.map +1 -1
- package/dist/app/config.js +4 -3
- package/dist/app/contracts.d.ts +40 -0
- package/dist/app/contracts.d.ts.map +1 -0
- package/dist/app/contracts.js +4 -0
- package/dist/app/editor-app.d.ts.map +1 -1
- package/dist/app/editor-app.js +316 -24
- package/dist/app/editor-app.test.js +144 -6
- package/dist/app/layout.d.ts +11 -2
- package/dist/app/layout.d.ts.map +1 -1
- package/dist/app/layout.js +170 -9
- package/dist/app/manifest.d.ts +7 -2
- package/dist/app/manifest.d.ts.map +1 -1
- package/dist/app/manifest.js +16 -4
- package/dist/app/shell-panels.d.ts +15 -0
- package/dist/app/shell-panels.d.ts.map +1 -1
- package/dist/app/small-screen.test.js +2 -2
- package/dist/app/stage-slots.d.ts +9 -0
- package/dist/app/stage-slots.d.ts.map +1 -0
- package/dist/app/stage-slots.js +10 -0
- package/dist/app/status-info.d.ts +2 -3
- package/dist/app/status-info.d.ts.map +1 -1
- package/dist/app/status-info.js +49 -16
- package/dist/canvas-host/canvas-frame.d.ts +13 -1
- package/dist/canvas-host/canvas-frame.d.ts.map +1 -1
- package/dist/canvas-host/canvas-frame.js +96 -8
- package/dist/canvas-host/canvas-frame.test.js +156 -3
- package/dist/canvas-host/host.d.ts +6 -0
- package/dist/canvas-host/host.d.ts.map +1 -1
- package/dist/canvas-host/host.js +116 -4
- package/dist/canvas-host/host.test.js +195 -6
- package/dist/clipboard/clipboard.d.ts +1 -1
- package/dist/clipboard/clipboard.d.ts.map +1 -1
- package/dist/clipboard/clipboard.js +5 -0
- package/dist/clipboard/clipboard.test.js +21 -1
- package/dist/clipboard/format.d.ts +3 -1
- package/dist/clipboard/format.d.ts.map +1 -1
- package/dist/clipboard/react.d.ts +1 -1
- package/dist/clipboard/react.d.ts.map +1 -1
- package/dist/clipboard/react.js +49 -3
- package/dist/dialogs/external-source.d.ts +15 -0
- package/dist/dialogs/external-source.d.ts.map +1 -0
- package/dist/dialogs/external-source.js +18 -0
- package/dist/dialogs/index.d.ts +4 -0
- package/dist/dialogs/index.d.ts.map +1 -1
- package/dist/dialogs/index.js +2 -0
- package/dist/dialogs/media-picker/index.d.ts +2 -2
- package/dist/dialogs/media-picker/index.d.ts.map +1 -1
- package/dist/dialogs/media-picker/index.js +1 -1
- package/dist/dialogs/media-picker/media-picker.d.ts +5 -0
- package/dist/dialogs/media-picker/media-picker.d.ts.map +1 -1
- package/dist/dialogs/media-picker/media-picker.js +67 -5
- package/dist/dialogs/media-picker/media-picker.test.js +72 -1
- package/dist/dialogs/media-picker/media-ref.d.ts +15 -0
- package/dist/dialogs/media-picker/media-ref.d.ts.map +1 -1
- package/dist/dialogs/media-picker/media-ref.js +29 -0
- package/dist/dialogs/remove-confirm.d.ts +14 -0
- package/dist/dialogs/remove-confirm.d.ts.map +1 -0
- package/dist/dialogs/remove-confirm.js +42 -0
- package/dist/dialogs/remove-confirm.test.d.ts +2 -0
- package/dist/dialogs/remove-confirm.test.d.ts.map +1 -0
- package/dist/dialogs/remove-confirm.test.js +118 -0
- package/dist/dnd/dnd-react.test.js +11 -2
- package/dist/dnd/dnd.test.js +23 -0
- package/dist/dnd/engine.d.ts +4 -2
- package/dist/dnd/engine.d.ts.map +1 -1
- package/dist/dnd/engine.js +6 -0
- package/dist/dnd/move-to-dialog.d.ts +4 -3
- package/dist/dnd/move-to-dialog.d.ts.map +1 -1
- package/dist/dnd/move-to-dialog.js +67 -10
- package/dist/dnd/react.d.ts.map +1 -1
- package/dist/dnd/react.js +5 -0
- package/dist/i18n/diagnostics.d.ts +22 -0
- package/dist/i18n/diagnostics.d.ts.map +1 -0
- package/dist/i18n/diagnostics.js +153 -0
- package/dist/i18n/diagnostics.test.d.ts +2 -0
- package/dist/i18n/diagnostics.test.d.ts.map +1 -0
- package/dist/i18n/diagnostics.test.js +74 -0
- package/dist/i18n/label-catalog.d.ts +20 -0
- package/dist/i18n/label-catalog.d.ts.map +1 -0
- package/dist/i18n/label-catalog.js +1 -0
- package/dist/i18n/locale-name.d.ts +7 -0
- package/dist/i18n/locale-name.d.ts.map +1 -0
- package/dist/i18n/locale-name.js +31 -0
- package/dist/i18n/localize-manifest.d.ts +11 -0
- package/dist/i18n/localize-manifest.d.ts.map +1 -0
- package/dist/i18n/localize-manifest.js +78 -0
- package/dist/i18n/localize-manifest.test.d.ts +2 -0
- package/dist/i18n/localize-manifest.test.d.ts.map +1 -0
- package/dist/i18n/localize-manifest.test.js +71 -0
- package/dist/messages/catalogs.test.d.ts +2 -0
- package/dist/messages/catalogs.test.d.ts.map +1 -0
- package/dist/messages/catalogs.test.js +80 -0
- package/dist/messages/en/app.d.ts +8 -0
- package/dist/messages/en/app.d.ts.map +1 -0
- package/dist/messages/en/app.js +7 -0
- package/dist/messages/en/blocks.d.ts +54 -0
- package/dist/messages/en/blocks.d.ts.map +1 -0
- package/dist/messages/en/blocks.js +53 -0
- package/dist/messages/en/canvas.d.ts +31 -0
- package/dist/messages/en/canvas.d.ts.map +1 -0
- package/dist/messages/en/canvas.js +30 -0
- package/dist/messages/en/clipboard.d.ts +13 -0
- package/dist/messages/en/clipboard.d.ts.map +1 -0
- package/dist/messages/en/clipboard.js +12 -0
- package/dist/messages/en/colorPicker.d.ts +20 -0
- package/dist/messages/en/colorPicker.d.ts.map +1 -0
- package/dist/messages/en/colorPicker.js +19 -0
- package/dist/messages/en/diagnostics.d.ts +40 -0
- package/dist/messages/en/diagnostics.d.ts.map +1 -0
- package/dist/messages/en/diagnostics.js +39 -0
- package/dist/messages/en/dialogs/common.d.ts +6 -0
- package/dist/messages/en/dialogs/common.d.ts.map +1 -0
- package/dist/messages/en/dialogs/common.js +5 -0
- package/dist/messages/en/dialogs/conflict.d.ts +15 -0
- package/dist/messages/en/dialogs/conflict.d.ts.map +1 -0
- package/dist/messages/en/dialogs/conflict.js +14 -0
- package/dist/messages/en/dialogs/delete.d.ts +19 -0
- package/dist/messages/en/dialogs/delete.d.ts.map +1 -0
- package/dist/messages/en/dialogs/delete.js +18 -0
- package/dist/messages/en/dialogs/pageOptions.d.ts +9 -0
- package/dist/messages/en/dialogs/pageOptions.d.ts.map +1 -0
- package/dist/messages/en/dialogs/pageOptions.js +8 -0
- package/dist/messages/en/dialogs/publish.d.ts +15 -0
- package/dist/messages/en/dialogs/publish.d.ts.map +1 -0
- package/dist/messages/en/dialogs/publish.js +14 -0
- package/dist/messages/en/dnd.d.ts +19 -0
- package/dist/messages/en/dnd.d.ts.map +1 -0
- package/dist/messages/en/dnd.js +18 -0
- package/dist/messages/en/editor.d.ts +30 -0
- package/dist/messages/en/editor.d.ts.map +1 -0
- package/dist/messages/en/editor.js +29 -0
- package/dist/messages/en/external.d.ts +6 -0
- package/dist/messages/en/external.d.ts.map +1 -0
- package/dist/messages/en/external.js +5 -0
- package/dist/messages/en/insert.d.ts +25 -0
- package/dist/messages/en/insert.d.ts.map +1 -0
- package/dist/messages/en/insert.js +24 -0
- package/dist/messages/en/inspector.d.ts +176 -0
- package/dist/messages/en/inspector.d.ts.map +1 -0
- package/dist/messages/en/inspector.js +175 -0
- package/dist/messages/en/issues.d.ts +36 -0
- package/dist/messages/en/issues.d.ts.map +1 -0
- package/dist/messages/en/issues.js +35 -0
- package/dist/messages/en/layers.d.ts +29 -0
- package/dist/messages/en/layers.d.ts.map +1 -0
- package/dist/messages/en/layers.js +28 -0
- package/dist/messages/en/leftPanel.d.ts +15 -0
- package/dist/messages/en/leftPanel.d.ts.map +1 -0
- package/dist/messages/en/leftPanel.js +14 -0
- package/dist/messages/en/list.d.ts +9 -0
- package/dist/messages/en/list.d.ts.map +1 -0
- package/dist/messages/en/list.js +8 -0
- package/dist/messages/en/locale.d.ts +4 -0
- package/dist/messages/en/locale.d.ts.map +1 -0
- package/dist/messages/en/locale.js +3 -0
- package/dist/messages/en/media.d.ts +51 -0
- package/dist/messages/en/media.d.ts.map +1 -0
- package/dist/messages/en/media.js +50 -0
- package/dist/messages/en/menu.d.ts +12 -0
- package/dist/messages/en/menu.d.ts.map +1 -0
- package/dist/messages/en/menu.js +11 -0
- package/dist/messages/en/patterns.d.ts +24 -0
- package/dist/messages/en/patterns.d.ts.map +1 -0
- package/dist/messages/en/patterns.js +23 -0
- package/dist/messages/en/preview.d.ts +8 -0
- package/dist/messages/en/preview.d.ts.map +1 -0
- package/dist/messages/en/preview.js +7 -0
- package/dist/messages/en/publish.d.ts +19 -0
- package/dist/messages/en/publish.d.ts.map +1 -0
- package/dist/messages/en/publish.js +18 -0
- package/dist/messages/en/richText.d.ts +21 -0
- package/dist/messages/en/richText.d.ts.map +1 -0
- package/dist/messages/en/richText.js +20 -0
- package/dist/messages/en/sample.d.ts +5 -0
- package/dist/messages/en/sample.d.ts.map +1 -0
- package/dist/messages/en/sample.js +4 -0
- package/dist/messages/en/save.d.ts +15 -0
- package/dist/messages/en/save.d.ts.map +1 -0
- package/dist/messages/en/save.js +14 -0
- package/dist/messages/en/shortcut.d.ts +36 -0
- package/dist/messages/en/shortcut.d.ts.map +1 -0
- package/dist/messages/en/shortcut.js +35 -0
- package/dist/messages/en/statusBar.d.ts +14 -0
- package/dist/messages/en/statusBar.d.ts.map +1 -0
- package/dist/messages/en/statusBar.js +13 -0
- package/dist/messages/en/structure.d.ts +28 -0
- package/dist/messages/en/structure.d.ts.map +1 -0
- package/dist/messages/en/structure.js +27 -0
- package/dist/messages/en/style.d.ts +168 -0
- package/dist/messages/en/style.d.ts.map +1 -0
- package/dist/messages/en/style.js +167 -0
- package/dist/messages/en/styleField.d.ts +301 -0
- package/dist/messages/en/styleField.d.ts.map +1 -0
- package/dist/messages/en/styleField.js +300 -0
- package/dist/messages/en/styleOption.d.ts +128 -0
- package/dist/messages/en/styleOption.d.ts.map +1 -0
- package/dist/messages/en/styleOption.js +127 -0
- package/dist/messages/en/styleSection.d.ts +16 -0
- package/dist/messages/en/styleSection.d.ts.map +1 -0
- package/dist/messages/en/styleSection.js +15 -0
- package/dist/messages/en/toast.d.ts +22 -0
- package/dist/messages/en/toast.d.ts.map +1 -0
- package/dist/messages/en/toast.js +21 -0
- package/dist/messages/en/toolbar.d.ts +47 -0
- package/dist/messages/en/toolbar.d.ts.map +1 -0
- package/dist/messages/en/toolbar.js +46 -0
- package/dist/messages/en/translation.d.ts +7 -0
- package/dist/messages/en/translation.d.ts.map +1 -0
- package/dist/messages/en/translation.js +6 -0
- package/dist/messages/en/ui.d.ts +4 -0
- package/dist/messages/en/ui.d.ts.map +1 -0
- package/dist/messages/en/ui.js +3 -0
- package/dist/messages/en/values.d.ts +45 -0
- package/dist/messages/en/values.d.ts.map +1 -0
- package/dist/messages/en/values.js +44 -0
- package/dist/messages/en.d.ts +1298 -202
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +82 -330
- package/dist/messages/index.d.ts +12 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/messages/index.js +28 -1
- package/dist/messages/pl/app.d.ts +8 -0
- package/dist/messages/pl/app.d.ts.map +1 -0
- package/dist/messages/pl/app.js +7 -0
- package/dist/messages/pl/blocks.d.ts +54 -0
- package/dist/messages/pl/blocks.d.ts.map +1 -0
- package/dist/messages/pl/blocks.js +53 -0
- package/dist/messages/pl/canvas.d.ts +31 -0
- package/dist/messages/pl/canvas.d.ts.map +1 -0
- package/dist/messages/pl/canvas.js +30 -0
- package/dist/messages/pl/clipboard.d.ts +13 -0
- package/dist/messages/pl/clipboard.d.ts.map +1 -0
- package/dist/messages/pl/clipboard.js +12 -0
- package/dist/messages/pl/colorPicker.d.ts +20 -0
- package/dist/messages/pl/colorPicker.d.ts.map +1 -0
- package/dist/messages/pl/colorPicker.js +19 -0
- package/dist/messages/pl/componentLabels.d.ts +9 -0
- package/dist/messages/pl/componentLabels.d.ts.map +1 -0
- package/dist/messages/pl/componentLabels.js +308 -0
- package/dist/messages/pl/diagnostics.d.ts +39 -0
- package/dist/messages/pl/diagnostics.d.ts.map +1 -0
- package/dist/messages/pl/diagnostics.js +38 -0
- package/dist/messages/pl/dialogs/common.d.ts +6 -0
- package/dist/messages/pl/dialogs/common.d.ts.map +1 -0
- package/dist/messages/pl/dialogs/common.js +5 -0
- package/dist/messages/pl/dialogs/conflict.d.ts +15 -0
- package/dist/messages/pl/dialogs/conflict.d.ts.map +1 -0
- package/dist/messages/pl/dialogs/conflict.js +14 -0
- package/dist/messages/pl/dialogs/delete.d.ts +19 -0
- package/dist/messages/pl/dialogs/delete.d.ts.map +1 -0
- package/dist/messages/pl/dialogs/delete.js +18 -0
- package/dist/messages/pl/dialogs/pageOptions.d.ts +9 -0
- package/dist/messages/pl/dialogs/pageOptions.d.ts.map +1 -0
- package/dist/messages/pl/dialogs/pageOptions.js +8 -0
- package/dist/messages/pl/dialogs/publish.d.ts +15 -0
- package/dist/messages/pl/dialogs/publish.d.ts.map +1 -0
- package/dist/messages/pl/dialogs/publish.js +14 -0
- package/dist/messages/pl/dnd.d.ts +19 -0
- package/dist/messages/pl/dnd.d.ts.map +1 -0
- package/dist/messages/pl/dnd.js +18 -0
- package/dist/messages/pl/editor.d.ts +30 -0
- package/dist/messages/pl/editor.d.ts.map +1 -0
- package/dist/messages/pl/editor.js +29 -0
- package/dist/messages/pl/external.d.ts +6 -0
- package/dist/messages/pl/external.d.ts.map +1 -0
- package/dist/messages/pl/external.js +5 -0
- package/dist/messages/pl/insert.d.ts +25 -0
- package/dist/messages/pl/insert.d.ts.map +1 -0
- package/dist/messages/pl/insert.js +24 -0
- package/dist/messages/pl/inspector.d.ts +176 -0
- package/dist/messages/pl/inspector.d.ts.map +1 -0
- package/dist/messages/pl/inspector.js +175 -0
- package/dist/messages/pl/issues.d.ts +36 -0
- package/dist/messages/pl/issues.d.ts.map +1 -0
- package/dist/messages/pl/issues.js +35 -0
- package/dist/messages/pl/layers.d.ts +29 -0
- package/dist/messages/pl/layers.d.ts.map +1 -0
- package/dist/messages/pl/layers.js +28 -0
- package/dist/messages/pl/leftPanel.d.ts +15 -0
- package/dist/messages/pl/leftPanel.d.ts.map +1 -0
- package/dist/messages/pl/leftPanel.js +14 -0
- package/dist/messages/pl/list.d.ts +9 -0
- package/dist/messages/pl/list.d.ts.map +1 -0
- package/dist/messages/pl/list.js +8 -0
- package/dist/messages/pl/locale.d.ts +4 -0
- package/dist/messages/pl/locale.d.ts.map +1 -0
- package/dist/messages/pl/locale.js +3 -0
- package/dist/messages/pl/media.d.ts +51 -0
- package/dist/messages/pl/media.d.ts.map +1 -0
- package/dist/messages/pl/media.js +50 -0
- package/dist/messages/pl/menu.d.ts +12 -0
- package/dist/messages/pl/menu.d.ts.map +1 -0
- package/dist/messages/pl/menu.js +11 -0
- package/dist/messages/pl/patterns.d.ts +24 -0
- package/dist/messages/pl/patterns.d.ts.map +1 -0
- package/dist/messages/pl/patterns.js +23 -0
- package/dist/messages/pl/preview.d.ts +8 -0
- package/dist/messages/pl/preview.d.ts.map +1 -0
- package/dist/messages/pl/preview.js +7 -0
- package/dist/messages/pl/publish.d.ts +19 -0
- package/dist/messages/pl/publish.d.ts.map +1 -0
- package/dist/messages/pl/publish.js +18 -0
- package/dist/messages/pl/richText.d.ts +21 -0
- package/dist/messages/pl/richText.d.ts.map +1 -0
- package/dist/messages/pl/richText.js +20 -0
- package/dist/messages/pl/sample.d.ts +5 -0
- package/dist/messages/pl/sample.d.ts.map +1 -0
- package/dist/messages/pl/sample.js +4 -0
- package/dist/messages/pl/save.d.ts +15 -0
- package/dist/messages/pl/save.d.ts.map +1 -0
- package/dist/messages/pl/save.js +14 -0
- package/dist/messages/pl/shortcut.d.ts +36 -0
- package/dist/messages/pl/shortcut.d.ts.map +1 -0
- package/dist/messages/pl/shortcut.js +35 -0
- package/dist/messages/pl/statusBar.d.ts +14 -0
- package/dist/messages/pl/statusBar.d.ts.map +1 -0
- package/dist/messages/pl/statusBar.js +13 -0
- package/dist/messages/pl/structure.d.ts +28 -0
- package/dist/messages/pl/structure.d.ts.map +1 -0
- package/dist/messages/pl/structure.js +27 -0
- package/dist/messages/pl/style.d.ts +168 -0
- package/dist/messages/pl/style.d.ts.map +1 -0
- package/dist/messages/pl/style.js +167 -0
- package/dist/messages/pl/styleField.d.ts +301 -0
- package/dist/messages/pl/styleField.d.ts.map +1 -0
- package/dist/messages/pl/styleField.js +300 -0
- package/dist/messages/pl/styleOption.d.ts +128 -0
- package/dist/messages/pl/styleOption.d.ts.map +1 -0
- package/dist/messages/pl/styleOption.js +127 -0
- package/dist/messages/pl/styleSection.d.ts +16 -0
- package/dist/messages/pl/styleSection.d.ts.map +1 -0
- package/dist/messages/pl/styleSection.js +15 -0
- package/dist/messages/pl/toast.d.ts +22 -0
- package/dist/messages/pl/toast.d.ts.map +1 -0
- package/dist/messages/pl/toast.js +21 -0
- package/dist/messages/pl/toolbar.d.ts +47 -0
- package/dist/messages/pl/toolbar.d.ts.map +1 -0
- package/dist/messages/pl/toolbar.js +46 -0
- package/dist/messages/pl/translation.d.ts +7 -0
- package/dist/messages/pl/translation.d.ts.map +1 -0
- package/dist/messages/pl/translation.js +6 -0
- package/dist/messages/pl/ui.d.ts +4 -0
- package/dist/messages/pl/ui.d.ts.map +1 -0
- package/dist/messages/pl/ui.js +3 -0
- package/dist/messages/pl/values.d.ts +45 -0
- package/dist/messages/pl/values.d.ts.map +1 -0
- package/dist/messages/pl/values.js +44 -0
- package/dist/messages/pl.d.ts.map +1 -1
- package/dist/messages/pl.js +82 -325
- package/dist/messages/plural.test.d.ts +2 -0
- package/dist/messages/plural.test.d.ts.map +1 -0
- package/dist/messages/plural.test.js +50 -0
- package/dist/panels/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/dist/panels/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/panels/breadcrumbs/breadcrumbs.js +10 -3
- package/dist/panels/breadcrumbs/breadcrumbs.test.js +9 -2
- package/dist/panels/index.d.ts +3 -0
- package/dist/panels/index.d.ts.map +1 -1
- package/dist/panels/index.js +1 -0
- package/dist/panels/insert/catalog.d.ts +21 -1
- package/dist/panels/insert/catalog.d.ts.map +1 -1
- package/dist/panels/insert/catalog.js +85 -3
- package/dist/panels/insert/catalog.order.test.js +106 -1
- package/dist/panels/insert/index.d.ts +1 -0
- package/dist/panels/insert/index.d.ts.map +1 -1
- package/dist/panels/insert/insert-panel.d.ts +14 -4
- package/dist/panels/insert/insert-panel.d.ts.map +1 -1
- package/dist/panels/insert/insert-panel.js +128 -69
- package/dist/panels/insert/insert-panel.test.js +278 -37
- package/dist/panels/insert/target.d.ts +5 -1
- package/dist/panels/insert/target.d.ts.map +1 -1
- package/dist/panels/insert/target.js +11 -1
- package/dist/panels/inspector/author-fields.d.ts +21 -0
- package/dist/panels/inspector/author-fields.d.ts.map +1 -0
- package/dist/panels/inspector/author-fields.js +191 -0
- package/dist/panels/inspector/author-fields.test.d.ts +2 -0
- package/dist/panels/inspector/author-fields.test.d.ts.map +1 -0
- package/dist/panels/inspector/author-fields.test.js +237 -0
- package/dist/panels/inspector/controls/external-link.d.ts +24 -0
- package/dist/panels/inspector/controls/external-link.d.ts.map +1 -0
- package/dist/panels/inspector/controls/external-link.js +43 -0
- package/dist/panels/inspector/controls/external-link.test.d.ts +2 -0
- package/dist/panels/inspector/controls/external-link.test.d.ts.map +1 -0
- package/dist/panels/inspector/controls/external-link.test.js +105 -0
- package/dist/panels/inspector/controls/index.d.ts +1 -0
- package/dist/panels/inspector/controls/index.d.ts.map +1 -1
- package/dist/panels/inspector/controls/index.js +1 -0
- package/dist/panels/inspector/controls/media.d.ts +3 -1
- package/dist/panels/inspector/controls/media.d.ts.map +1 -1
- package/dist/panels/inspector/controls/media.js +8 -3
- package/dist/panels/inspector/controls/rich-text.d.ts.map +1 -1
- package/dist/panels/inspector/controls/rich-text.js +36 -6
- package/dist/panels/inspector/controls/textarea.d.ts +7 -2
- package/dist/panels/inspector/controls/textarea.d.ts.map +1 -1
- package/dist/panels/inspector/controls/textarea.js +37 -2
- package/dist/panels/inspector/default-hint.d.ts +13 -0
- package/dist/panels/inspector/default-hint.d.ts.map +1 -0
- package/dist/panels/inspector/default-hint.js +30 -0
- package/dist/panels/inspector/default-hint.test.d.ts +2 -0
- package/dist/panels/inspector/default-hint.test.d.ts.map +1 -0
- package/dist/panels/inspector/default-hint.test.js +46 -0
- package/dist/panels/inspector/index.d.ts +3 -3
- package/dist/panels/inspector/index.d.ts.map +1 -1
- package/dist/panels/inspector/index.js +2 -2
- package/dist/panels/inspector/inspector.d.ts +20 -2
- package/dist/panels/inspector/inspector.d.ts.map +1 -1
- package/dist/panels/inspector/inspector.js +246 -26
- package/dist/panels/inspector/inspector.test.js +276 -11
- package/dist/panels/inspector/props-panel.d.ts +36 -0
- package/dist/panels/inspector/props-panel.d.ts.map +1 -1
- package/dist/panels/inspector/props-panel.js +99 -17
- package/dist/panels/inspector/props-panel.test.d.ts +2 -0
- package/dist/panels/inspector/props-panel.test.d.ts.map +1 -0
- package/dist/panels/inspector/props-panel.test.js +17 -0
- package/dist/panels/inspector/scrub-label.d.ts +14 -0
- package/dist/panels/inspector/scrub-label.d.ts.map +1 -0
- package/dist/panels/inspector/scrub-label.js +75 -0
- package/dist/panels/inspector/scrub-label.test.d.ts +2 -0
- package/dist/panels/inspector/scrub-label.test.d.ts.map +1 -0
- package/dist/panels/inspector/scrub-label.test.js +132 -0
- package/dist/panels/inspector/styles/background-media.d.ts +28 -0
- package/dist/panels/inspector/styles/background-media.d.ts.map +1 -0
- package/dist/panels/inspector/styles/background-media.js +78 -0
- package/dist/panels/inspector/styles/box-model.d.ts +13 -16
- package/dist/panels/inspector/styles/box-model.d.ts.map +1 -1
- package/dist/panels/inspector/styles/box-model.js +10 -25
- package/dist/panels/inspector/styles/color-input.d.ts +3 -0
- package/dist/panels/inspector/styles/color-input.d.ts.map +1 -0
- package/dist/panels/inspector/styles/color-input.js +72 -0
- package/dist/panels/inspector/styles/gradient-fields.d.ts +9 -0
- package/dist/panels/inspector/styles/gradient-fields.d.ts.map +1 -0
- package/dist/panels/inspector/styles/gradient-fields.js +50 -0
- package/dist/panels/inspector/styles/index.d.ts +2 -0
- package/dist/panels/inspector/styles/index.d.ts.map +1 -1
- package/dist/panels/inspector/styles/index.js +2 -0
- package/dist/panels/inspector/styles/model.d.ts +27 -5
- package/dist/panels/inspector/styles/model.d.ts.map +1 -1
- package/dist/panels/inspector/styles/model.js +101 -3
- package/dist/panels/inspector/styles/motion-rows.d.ts +17 -0
- package/dist/panels/inspector/styles/motion-rows.d.ts.map +1 -0
- package/dist/panels/inspector/styles/motion-rows.js +117 -0
- package/dist/panels/inspector/styles/number-input.d.ts +4 -0
- package/dist/panels/inspector/styles/number-input.d.ts.map +1 -0
- package/dist/panels/inspector/styles/number-input.js +12 -0
- package/dist/panels/inspector/styles/option-label.d.ts +7 -0
- package/dist/panels/inspector/styles/option-label.d.ts.map +1 -0
- package/dist/panels/inspector/styles/option-label.js +9 -0
- package/dist/panels/inspector/styles/property-label.d.ts +9 -0
- package/dist/panels/inspector/styles/property-label.d.ts.map +1 -0
- package/dist/panels/inspector/styles/property-label.js +11 -0
- package/dist/panels/inspector/styles/section-state.d.ts +22 -0
- package/dist/panels/inspector/styles/section-state.d.ts.map +1 -0
- package/dist/panels/inspector/styles/section-state.js +96 -0
- package/dist/panels/inspector/styles/section.d.ts +25 -0
- package/dist/panels/inspector/styles/section.d.ts.map +1 -0
- package/dist/panels/inspector/styles/section.js +43 -0
- package/dist/panels/inspector/styles/sections-context.d.ts +13 -0
- package/dist/panels/inspector/styles/sections-context.d.ts.map +1 -0
- package/dist/panels/inspector/styles/sections-context.js +19 -0
- package/dist/panels/inspector/styles/sections-context.test.d.ts +2 -0
- package/dist/panels/inspector/styles/sections-context.test.d.ts.map +1 -0
- package/dist/panels/inspector/styles/sections-context.test.js +18 -0
- package/dist/panels/inspector/styles/sections-toggle.d.ts +6 -0
- package/dist/panels/inspector/styles/sections-toggle.d.ts.map +1 -0
- package/dist/panels/inspector/styles/sections-toggle.js +18 -0
- package/dist/panels/inspector/styles/segments.d.ts +3 -0
- package/dist/panels/inspector/styles/segments.d.ts.map +1 -1
- package/dist/panels/inspector/styles/segments.js +11 -4
- package/dist/panels/inspector/styles/sides-editor.d.ts +1 -1
- package/dist/panels/inspector/styles/sides-editor.d.ts.map +1 -1
- package/dist/panels/inspector/styles/sides-editor.js +33 -4
- package/dist/panels/inspector/styles/style-inspector.d.ts +3 -1
- package/dist/panels/inspector/styles/style-inspector.d.ts.map +1 -1
- package/dist/panels/inspector/styles/style-inspector.js +610 -42
- package/dist/panels/inspector/styles/style-inspector.test.js +694 -14
- package/dist/panels/inspector/styles/token-picker.d.ts +1 -1
- package/dist/panels/inspector/styles/token-picker.d.ts.map +1 -1
- package/dist/panels/inspector/styles/token-picker.js +10 -3
- package/dist/panels/inspector/styles/widgets.d.ts +116 -0
- package/dist/panels/inspector/styles/widgets.d.ts.map +1 -0
- package/dist/panels/inspector/styles/widgets.js +304 -0
- package/dist/panels/inspector/styles/widgets.test.d.ts +2 -0
- package/dist/panels/inspector/styles/widgets.test.d.ts.map +1 -0
- package/dist/panels/inspector/styles/widgets.test.js +247 -0
- package/dist/panels/inspector/values/value-editor.d.ts +1 -1
- package/dist/panels/inspector/values/value-editor.d.ts.map +1 -1
- package/dist/panels/inspector/values/value-editor.js +9 -8
- package/dist/panels/inspector/values/values.test.js +9 -3
- package/dist/panels/issues/collect.d.ts +2 -0
- package/dist/panels/issues/collect.d.ts.map +1 -1
- package/dist/panels/issues/collect.js +1 -0
- package/dist/panels/issues/index.d.ts +1 -0
- package/dist/panels/issues/index.d.ts.map +1 -1
- package/dist/panels/issues/index.js +1 -0
- package/dist/panels/issues/issues-panel.d.ts +4 -3
- package/dist/panels/issues/issues-panel.d.ts.map +1 -1
- package/dist/panels/issues/issues-panel.js +22 -35
- package/dist/panels/issues/path.d.ts +7 -0
- package/dist/panels/issues/path.d.ts.map +1 -0
- package/dist/panels/issues/path.js +21 -0
- package/dist/panels/layers/flatten.d.ts +16 -2
- package/dist/panels/layers/flatten.d.ts.map +1 -1
- package/dist/panels/layers/flatten.js +48 -4
- package/dist/panels/layers/layers-panel.d.ts +5 -2
- package/dist/panels/layers/layers-panel.d.ts.map +1 -1
- package/dist/panels/layers/layers-panel.js +177 -35
- package/dist/panels/layers/layers-panel.test.js +173 -15
- package/dist/panels/left-panel.d.ts +17 -0
- package/dist/panels/left-panel.d.ts.map +1 -0
- package/dist/panels/left-panel.js +47 -0
- package/dist/panels/left-panel.test.d.ts +2 -0
- package/dist/panels/left-panel.test.d.ts.map +1 -0
- package/dist/panels/left-panel.test.js +77 -0
- package/dist/persistence/persistence.test.js +9 -3
- package/dist/persistence/react.d.ts.map +1 -1
- package/dist/persistence/react.js +2 -2
- package/dist/preview/preview.d.ts +8 -0
- package/dist/preview/preview.d.ts.map +1 -1
- package/dist/preview/preview.js +21 -1
- package/dist/preview/preview.test.js +18 -1
- package/dist/shortcuts/actions.d.ts +13 -2
- package/dist/shortcuts/actions.d.ts.map +1 -1
- package/dist/shortcuts/actions.js +70 -15
- package/dist/shortcuts/help.d.ts +11 -0
- package/dist/shortcuts/help.d.ts.map +1 -0
- package/dist/shortcuts/help.js +77 -0
- package/dist/shortcuts/index.d.ts +5 -2
- package/dist/shortcuts/index.d.ts.map +1 -1
- package/dist/shortcuts/index.js +3 -1
- package/dist/shortcuts/map.d.ts +1 -1
- package/dist/shortcuts/map.d.ts.map +1 -1
- package/dist/shortcuts/map.js +14 -8
- package/dist/shortcuts/navigation.d.ts +13 -0
- package/dist/shortcuts/navigation.d.ts.map +1 -0
- package/dist/shortcuts/navigation.js +48 -0
- package/dist/shortcuts/shortcuts.d.ts +12 -1
- package/dist/shortcuts/shortcuts.d.ts.map +1 -1
- package/dist/shortcuts/shortcuts.js +61 -14
- package/dist/shortcuts/shortcuts.test.js +206 -5
- package/dist/store/create-store.d.ts.map +1 -1
- package/dist/store/create-store.js +19 -1
- package/dist/store/index.d.ts +4 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +3 -1
- package/dist/store/react.d.ts +4 -0
- package/dist/store/react.d.ts.map +1 -1
- package/dist/store/react.js +7 -0
- package/dist/store/store.test.js +24 -0
- package/dist/store/structure-lock.d.ts +16 -0
- package/dist/store/structure-lock.d.ts.map +1 -0
- package/dist/store/structure-lock.js +43 -0
- package/dist/store/structure-lock.test.d.ts +2 -0
- package/dist/store/structure-lock.test.d.ts.map +1 -0
- package/dist/store/structure-lock.test.js +49 -0
- package/dist/store/types.d.ts +9 -0
- package/dist/store/types.d.ts.map +1 -1
- package/dist/store/view.d.ts +20 -0
- package/dist/store/view.d.ts.map +1 -0
- package/dist/store/view.js +17 -0
- package/dist/store/view.test.d.ts +2 -0
- package/dist/store/view.test.d.ts.map +1 -0
- package/dist/store/view.test.js +103 -0
- package/dist/styles/tokens.test.js +88 -9
- package/dist/styles.css +4112 -586
- package/dist/toolbar/brand.d.ts +2 -2
- package/dist/toolbar/brand.d.ts.map +1 -1
- package/dist/toolbar/brand.js +4 -4
- package/dist/toolbar/breakpoint-control.d.ts +4 -0
- package/dist/toolbar/breakpoint-control.d.ts.map +1 -1
- package/dist/toolbar/breakpoint-control.js +11 -4
- package/dist/toolbar/editable-title.d.ts +4 -1
- package/dist/toolbar/editable-title.d.ts.map +1 -1
- package/dist/toolbar/editable-title.js +2 -2
- package/dist/toolbar/editable-title.test.js +10 -0
- package/dist/toolbar/locale-chip.d.ts +10 -0
- package/dist/toolbar/locale-chip.d.ts.map +1 -0
- package/dist/toolbar/locale-chip.js +27 -0
- package/dist/toolbar/locale-switcher.d.ts.map +1 -1
- package/dist/toolbar/locale-switcher.js +4 -1
- package/dist/toolbar/more-menu.d.ts +26 -4
- package/dist/toolbar/more-menu.d.ts.map +1 -1
- package/dist/toolbar/more-menu.js +60 -13
- package/dist/toolbar/page-chip.d.ts +10 -0
- package/dist/toolbar/page-chip.d.ts.map +1 -0
- package/dist/toolbar/page-chip.js +12 -0
- package/dist/toolbar/page-options-dialog.d.ts +16 -0
- package/dist/toolbar/page-options-dialog.d.ts.map +1 -0
- package/dist/toolbar/page-options-dialog.js +13 -0
- package/dist/toolbar/panel-toggles.d.ts +3 -2
- package/dist/toolbar/panel-toggles.d.ts.map +1 -1
- package/dist/toolbar/panel-toggles.js +9 -4
- package/dist/toolbar/publish-dialog.d.ts +3 -0
- package/dist/toolbar/publish-dialog.d.ts.map +1 -1
- package/dist/toolbar/publish-dialog.js +34 -7
- package/dist/toolbar/publish.test.js +63 -19
- package/dist/toolbar/safe-history.d.ts +3 -0
- package/dist/toolbar/safe-history.d.ts.map +1 -0
- package/dist/toolbar/safe-history.js +5 -0
- package/dist/toolbar/sample-picker.d.ts +24 -4
- package/dist/toolbar/sample-picker.d.ts.map +1 -1
- package/dist/toolbar/sample-picker.js +42 -18
- package/dist/toolbar/toolbar-centre.d.ts +3 -11
- package/dist/toolbar/toolbar-centre.d.ts.map +1 -1
- package/dist/toolbar/toolbar-centre.js +4 -5
- package/dist/toolbar/toolbar-left.d.ts +4 -7
- package/dist/toolbar/toolbar-left.d.ts.map +1 -1
- package/dist/toolbar/toolbar-left.js +13 -11
- package/dist/toolbar/toolbar-right.d.ts +21 -6
- package/dist/toolbar/toolbar-right.d.ts.map +1 -1
- package/dist/toolbar/toolbar-right.js +28 -14
- package/dist/toolbar/toolbar.d.ts +23 -17
- package/dist/toolbar/toolbar.d.ts.map +1 -1
- package/dist/toolbar/toolbar.js +28 -11
- package/dist/toolbar/toolbar.test.js +238 -23
- package/dist/toolbar/use-overflow-level.d.ts +2 -1
- package/dist/toolbar/use-overflow-level.d.ts.map +1 -1
- package/dist/toolbar/use-overflow-level.js +9 -3
- package/dist/toolbar/zoom-menu.d.ts +5 -1
- package/dist/toolbar/zoom-menu.d.ts.map +1 -1
- package/dist/toolbar/zoom-menu.js +3 -2
- package/dist/ui/icon.d.ts +53 -0
- package/dist/ui/icon.d.ts.map +1 -1
- package/dist/ui/icon.js +58 -1
- package/dist/ui/icon.test.js +101 -3
- package/dist/ui/index.d.ts +4 -3
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -2
- package/dist/ui/primitives.d.ts +97 -14
- package/dist/ui/primitives.d.ts.map +1 -1
- package/dist/ui/primitives.js +108 -22
- package/dist/ui/primitives.test.js +204 -3
- package/dist/ui/structure-locked.d.ts +9 -0
- package/dist/ui/structure-locked.d.ts.map +1 -0
- package/dist/ui/structure-locked.js +28 -0
- package/dist/ui/toast.d.ts +3 -1
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +21 -5
- package/dist/ui/toast.test.js +34 -0
- package/package.json +5 -4
|
@@ -1,20 +1,73 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { canEdit, createIndex, defaultTheme, effectiveStyles, getStyleProperty, propertiesOfGroup, STYLE_GROUPS, } from '@next-buildr/core';
|
|
3
3
|
import { useId, useState } from 'react';
|
|
4
4
|
import { componentMeta, useManifest } from '../../../app/manifest.js';
|
|
5
|
-
import { useT } from '../../../messages/index.js';
|
|
5
|
+
import { interpolate, useT } from '../../../messages/index.js';
|
|
6
6
|
import { useEditor, useEditorState } from '../../../store/index.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Button, Icon, Input, SegmentedControl, Tooltip } from '../../../ui/index.js';
|
|
8
|
+
import { ScrubLabel } from '../scrub-label.js';
|
|
9
|
+
import { readProp } from '../value.js';
|
|
10
|
+
import { BackgroundMediaFields, backgroundMediaSupport, hasMedia, mediaToClear, } from './background-media.js';
|
|
11
|
+
import { BoxModel } from './box-model.js';
|
|
12
|
+
import { GradientFields } from './gradient-fields.js';
|
|
13
|
+
import { boundsOf, checkStyleInput, colorOf, isEnumeration, isNumeric, KEYWORD_DEFAULTS, keywordsOf, layerFor, partsOf, RANGES, rangeShown, rangeText, sliderOf, stepOf, takesNumber, unitsOf, } from './model.js';
|
|
14
|
+
import { MotionRows } from './motion-rows.js';
|
|
15
|
+
import { NumberUnitInput } from './number-input.js';
|
|
16
|
+
import { optionLabel } from './option-label.js';
|
|
17
|
+
import { Highlight, propertyLabel } from './property-label.js';
|
|
18
|
+
import { StyleSection } from './section.js';
|
|
9
19
|
import { PAIRS, SEGMENTED } from './segments.js';
|
|
10
20
|
import { SidesEditor } from './sides-editor.js';
|
|
11
21
|
import { TokenPicker } from './token-picker.js';
|
|
12
22
|
import { useStyleValue } from './use-style-value.js';
|
|
23
|
+
import { AlignmentPad, ColorField, RangeSlider, ResetField, ShadowEditor, shadowLayers, } from './widgets.js';
|
|
13
24
|
const pathOf = (def, part) => `${def.group}.${def.name}${part !== undefined ? `.${part}` : ''}`;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
const SHADOW = {
|
|
26
|
+
shadowX: '0px',
|
|
27
|
+
shadowY: '0px',
|
|
28
|
+
shadowBlur: '0px',
|
|
29
|
+
shadowSpread: '0px',
|
|
30
|
+
shadowColor: '#00000026',
|
|
31
|
+
shadowInset: 'outset',
|
|
32
|
+
};
|
|
33
|
+
const TEXT_SHADOW = {
|
|
34
|
+
textShadowX: '0px',
|
|
35
|
+
textShadowY: '0px',
|
|
36
|
+
textShadowBlur: '0px',
|
|
37
|
+
textShadowColor: '#00000026',
|
|
38
|
+
};
|
|
39
|
+
const FILTERS = {
|
|
40
|
+
blur: '0px',
|
|
41
|
+
brightness: 1,
|
|
42
|
+
contrast: 1,
|
|
43
|
+
saturate: 1,
|
|
44
|
+
grayscale: 0,
|
|
45
|
+
sepia: 0,
|
|
46
|
+
hueRotate: '0deg',
|
|
47
|
+
invert: 0,
|
|
48
|
+
};
|
|
49
|
+
const TRANSFORMS = {
|
|
50
|
+
translateX: '0px',
|
|
51
|
+
translateY: '0px',
|
|
52
|
+
rotate: '0deg',
|
|
53
|
+
scale: 1,
|
|
54
|
+
skewX: '0deg',
|
|
55
|
+
skewY: '0deg',
|
|
56
|
+
};
|
|
57
|
+
function compoundFor(name) {
|
|
58
|
+
return [SHADOW, TEXT_SHADOW, FILTERS, TRANSFORMS].find((group) => Object.hasOwn(group, name));
|
|
59
|
+
}
|
|
60
|
+
function sourceLabel(source, t) {
|
|
61
|
+
if (source === 'base')
|
|
62
|
+
return t('style.desktop');
|
|
63
|
+
if (source === 'state:hover')
|
|
64
|
+
return t('style.source.hover');
|
|
65
|
+
if (source === 'state:focus-visible')
|
|
66
|
+
return t('style.source.focus-visible');
|
|
67
|
+
if (source === 'state:active')
|
|
68
|
+
return t('style.source.active');
|
|
69
|
+
return source;
|
|
70
|
+
}
|
|
18
71
|
/** The dot beside a property: set on this breakpoint, inherited from a wider one, or the default. */
|
|
19
72
|
function SourceDot(props) {
|
|
20
73
|
const t = useT();
|
|
@@ -45,17 +98,54 @@ function ValueField(props) {
|
|
|
45
98
|
const describedBy = error !== '' ? `${id}-error` : undefined;
|
|
46
99
|
const listId = props.keywords.length > 0 ? `${id}-list` : undefined;
|
|
47
100
|
const swatch = colorOf(def, shown.trim(), props.theme);
|
|
48
|
-
const slider = sliderOf(def);
|
|
49
|
-
|
|
101
|
+
const slider = RANGES[path] === undefined ? sliderOf(def) : undefined;
|
|
102
|
+
const range = RANGES[path];
|
|
103
|
+
const rangeValue = Number.parseFloat(shown);
|
|
104
|
+
const hinted = props.hint !== undefined ? Number.parseFloat(props.hint) : Number.NaN;
|
|
105
|
+
// The colour a field has while none is set: the hint, else the theme's text colour for text.
|
|
106
|
+
const textColor = props.theme.tokens.color['text'];
|
|
107
|
+
const hintColor = props.hint !== undefined ? (colorOf(def, props.hint, props.theme) ?? props.hint) : undefined;
|
|
108
|
+
const fallbackColor = props.hint !== undefined && hintColor !== undefined
|
|
109
|
+
? { text: props.hint, color: hintColor }
|
|
110
|
+
: path === 'typography.color' && textColor !== undefined
|
|
111
|
+
? { text: textColor, color: textColor }
|
|
112
|
+
: undefined;
|
|
113
|
+
return (_jsxs("div", { className: "bd-style-value", "data-path": path, "data-source": current?.source ?? 'none', children: [path === 'size.width' ? (_jsx(SegmentedControl, { label: t('style.width.mode'), value: shown === '100%' ? 'full' : shown === 'auto' || shown === '' ? 'auto' : 'custom', disabled: props.disabled, options: [
|
|
114
|
+
{ value: 'auto', label: t('style.width.auto') },
|
|
115
|
+
{ value: 'full', label: t('style.width.full') },
|
|
116
|
+
{ value: 'custom', label: t('style.width.custom') },
|
|
117
|
+
], onValueChange: (mode) => {
|
|
118
|
+
if (mode === 'custom')
|
|
119
|
+
document.getElementById(id)?.focus();
|
|
120
|
+
else
|
|
121
|
+
field.change(mode === 'full' ? '100%' : 'auto');
|
|
122
|
+
} })) : null, props.hideLabel === true ? null : (_jsx("label", { htmlFor: id, className: "bd-field-label", children: props.label })), _jsxs("div", { className: "bd-style-input", children: [def.grammar.kind === 'color' ? (_jsx(ColorField, { id: id, text: shown, swatch: swatch, theme: props.theme, label: `${props.label}: ${t('style.colorPicker')}`, ariaLabel: ariaLabel, disabled: props.disabled, invalid: error !== '', describedBy: describedBy, fallback: fallbackColor, onText: field.change, onSwatch: (text) => {
|
|
123
|
+
const checked = checkStyleInput(def, text, props.theme);
|
|
124
|
+
if (checked.ok)
|
|
125
|
+
field.pick(text);
|
|
126
|
+
}, onBlur: field.blur, trailing: _jsx(TokenPicker, { def: def, theme: props.theme, label: props.label, current: current !== undefined ? String(current.value) : undefined, disabled: props.disabled, onPick: field.pick }) })) : null, def.grammar.kind === 'color' ? null : isNumeric(def) ? (_jsx(NumberUnitInput, { id: id, value: shown, units: unitsOf(def), unitLabel: `${t('style.unit')}: ${props.label}`, unitLabels: { deg: t('style.unit.deg') }, step: stepOf(def), bareNumber: takesNumber(def), placeholder: props.hint !== undefined && Number.isFinite(hinted)
|
|
127
|
+
? String(hinted)
|
|
128
|
+
: range !== undefined
|
|
129
|
+
? String(range.fallback)
|
|
130
|
+
: undefined, disabled: props.disabled, invalid: error !== '', describedBy: describedBy, ariaLabel: ariaLabel, list: listId, onValueChange: field.change, onBlur: field.blur })) : (_jsx(Input, { id: id, value: shown, disabled: props.disabled, list: listId, "aria-invalid": error !== '', "aria-describedby": describedBy, "aria-label": ariaLabel, autoComplete: "off", spellCheck: false, onChange: (event) => field.change(event.target.value), onBlur: field.blur })), def.grammar.kind === 'color' ? null : (_jsx(TokenPicker, { def: def, theme: props.theme, label: props.label, current: current !== undefined ? String(current.value) : undefined, disabled: props.disabled, onPick: field.pick }))] }), def.grammar.kind === 'gradient' ? (_jsx(GradientFields, { value: field.stored, theme: props.theme, disabled: props.disabled, onChange: (text) => {
|
|
131
|
+
const checked = checkStyleInput(def, text, props.theme);
|
|
132
|
+
if (checked.ok)
|
|
133
|
+
field.pick(text);
|
|
134
|
+
} })) : null, slider !== undefined ? (_jsx(RangeSlider, { label: `${props.label}: ${t('style.slider')}`, min: slider.min, max: slider.max, step: slider.step, value: Number.isFinite(Number(field.stored)) && field.stored !== ''
|
|
50
135
|
? Number(field.stored)
|
|
51
|
-
: slider.max, disabled: props.disabled, onChange:
|
|
136
|
+
: slider.max, disabled: props.disabled, onChange: field.change })) : null, range !== undefined ? (_jsx(RangeSlider, { label: `${props.label}: ${t('style.slider')}`, min: range.min, max: range.max, step: range.step, value: Number.isFinite(rangeValue)
|
|
137
|
+
? rangeValue
|
|
138
|
+
: Number.isFinite(hinted)
|
|
139
|
+
? hinted
|
|
140
|
+
: range.fallback, format: (value) => rangeShown(range, value), unset: !Number.isFinite(rangeValue), disabled: props.disabled, onChange: (text) => field.change(rangeText(range, Number(text))) })) : null, path === 'layout.gap' ? (_jsx(RangeSlider, { label: `${props.label}: ${t('style.slider')}`, min: 0, max: 64, step: 1, value: Number.parseFloat(shown) || 0, unit: "px", disabled: props.disabled, onChange: (value) => field.change(`${value}px`) })) : null, listId !== undefined ? (_jsx("datalist", { id: listId, children: props.keywords.map((keyword) => (_jsx("option", { value: keyword }, keyword))) })) : null, field.inherited && current !== undefined ? (_jsx("span", { className: "bd-style-source", children: `${t('style.from')} ${sourceLabel(current.source, t)}` })) : null, error !== '' ? (_jsx("p", { id: `${id}-error`, role: "alert", className: "bd-style-error", children: error })) : null] }));
|
|
52
141
|
}
|
|
53
142
|
function StyleProperty(props) {
|
|
54
143
|
const t = useT();
|
|
55
144
|
const store = useEditor();
|
|
56
145
|
const { def, nodeId, effective, layer } = props;
|
|
57
146
|
const id = useId();
|
|
58
|
-
const label = def
|
|
147
|
+
const label = propertyLabel(def, t);
|
|
148
|
+
const shownLabel = _jsx(Highlight, { text: label, query: props.query });
|
|
59
149
|
const parts = partsOf(def);
|
|
60
150
|
const layerObject = layerFor(layer);
|
|
61
151
|
const setOne = (value, part) => store.dispatch({
|
|
@@ -96,57 +186,114 @@ function StyleProperty(props) {
|
|
|
96
186
|
});
|
|
97
187
|
props.onError(failure);
|
|
98
188
|
};
|
|
99
|
-
const set = (value, part) =>
|
|
189
|
+
const set = (value, part) => {
|
|
190
|
+
const compound = compoundFor(def.name);
|
|
191
|
+
if (def.group !== 'effects' || compound === undefined)
|
|
192
|
+
return report(setOne(value, part));
|
|
193
|
+
let failure = '';
|
|
194
|
+
store.transaction(label, () => {
|
|
195
|
+
for (const [property, fallback] of Object.entries(compound)) {
|
|
196
|
+
const result = store.dispatch({
|
|
197
|
+
type: 'node.setStyle',
|
|
198
|
+
payload: {
|
|
199
|
+
id: nodeId,
|
|
200
|
+
layer: layerObject,
|
|
201
|
+
group: 'effects',
|
|
202
|
+
property,
|
|
203
|
+
value: property === def.name
|
|
204
|
+
? value
|
|
205
|
+
: (effective[`effects.${property}`]?.value ?? props.hints?.[property] ?? fallback),
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
if (!result.ok)
|
|
209
|
+
failure ||= result.error?.message ?? '';
|
|
210
|
+
}
|
|
211
|
+
return failure === '';
|
|
212
|
+
});
|
|
213
|
+
props.onError(failure);
|
|
214
|
+
};
|
|
100
215
|
const unset = (part) => report(unsetOne(part));
|
|
101
216
|
const paths = parts.length > 0 ? parts.map((part) => pathOf(def, part)) : [pathOf(def)];
|
|
102
217
|
const here = paths.some((path) => effective[path]?.source === layer);
|
|
103
218
|
const known = paths.map((path) => effective[path]).filter((entry) => entry !== undefined);
|
|
104
219
|
const origin = here ? 'set' : known.length > 0 ? 'inherited' : 'default';
|
|
105
|
-
const from = known[0]
|
|
220
|
+
const from = known[0] !== undefined ? sourceLabel(known[0].source, t) : undefined;
|
|
106
221
|
const base = { def, effective, layer, theme: props.theme, disabled: props.disabled };
|
|
107
222
|
const keywords = keywordsOf(def);
|
|
108
223
|
const key = pathOf(def);
|
|
109
|
-
const head = (control, extras) => (_jsxs("div", { className: "bd-style-head", children: [control, extras, _jsx(SourceDot, { origin: origin, from: from }),
|
|
224
|
+
const head = (control, extras) => (_jsxs("div", { className: "bd-style-head", children: [control, extras, _jsx(SourceDot, { origin: origin, from: from }), layer !== 'base' && !layer.startsWith('state:') ? (_jsx(Tooltip, { content: here ? t('style.override') : `${t('style.editing')}: ${layer}`, children: _jsx("span", { className: "bd-device-indicator", "data-override": here, role: "img", "aria-label": here ? t('style.override') : layer, children: _jsx(Icon, { name: layer === 'mobile'
|
|
225
|
+
? 'smartphone'
|
|
226
|
+
: layer === 'tablet'
|
|
227
|
+
? 'tablet'
|
|
228
|
+
: 'monitor-smartphone' }) }) })) : null, _jsx(ResetField, { label: label, changed: here, disabled: props.disabled, onReset: () => parts.length > 0
|
|
110
229
|
? apply(parts
|
|
111
230
|
.filter((part) => effective[pathOf(def, part)]?.source === layer)
|
|
112
231
|
.map((part) => ({ part, value: undefined })))
|
|
113
|
-
: unset() })
|
|
232
|
+
: unset() })] }));
|
|
114
233
|
if (def.grammar.kind === 'boolean') {
|
|
115
234
|
const value = effective[key];
|
|
116
|
-
return (_jsx("div", { className: "bd-field bd-style-field", "data-style-prop": key, "data-origin": origin, children: head(_jsxs("label", { className: "bd-style-check", children: [_jsx("input", { type: "checkbox", checked: value?.value === true, disabled: props.disabled, onChange: (event) => (event.target.checked ? set(true) : unset()) }),
|
|
235
|
+
return (_jsx("div", { className: "bd-field bd-style-field", "data-style-prop": key, "data-origin": origin, children: head(_jsxs("label", { className: "bd-style-check", children: [_jsx("input", { type: "checkbox", checked: value?.value === true, disabled: props.disabled, onChange: (event) => (event.target.checked ? set(true) : unset()) }), shownLabel] })) }));
|
|
117
236
|
}
|
|
118
237
|
if (parts.length > 0) {
|
|
119
|
-
return (_jsx("div", { className: props.ring === true ? 'bd-style-field bd-style-ring' : 'bd-field bd-style-field', "data-style-prop": key, "data-origin": origin, children: _jsx(SidesEditor, { ...base, label: label, parts: parts, layout: props.ring === true ? 'ring' : 'row', apply: apply, renderHead: (extras) => head(_jsx("span", { className: "bd-field-label", children:
|
|
238
|
+
return (_jsx("div", { className: props.ring === true ? 'bd-style-field bd-style-ring' : 'bd-field bd-style-field', "data-style-prop": key, "data-origin": origin, children: _jsx(SidesEditor, { ...base, label: label, parts: parts, layout: props.ring === true ? 'ring' : 'row', apply: apply, renderHead: (extras) => head(_jsx("span", { className: "bd-field-label", children: props.ring === true && (def.name === 'margin' || def.name === 'padding')
|
|
239
|
+
? t(`styleField.spacing.${def.name}`)
|
|
240
|
+
: shownLabel }), extras), children: props.children }) }));
|
|
120
241
|
}
|
|
121
|
-
let title = _jsx("span", { className: "bd-field-label", children:
|
|
242
|
+
let title = _jsx("span", { className: "bd-field-label", children: shownLabel });
|
|
122
243
|
let body;
|
|
123
244
|
if (isEnumeration(def)) {
|
|
124
245
|
const current = effective[key];
|
|
125
246
|
const segments = SEGMENTED[key]?.filter((segment) => keywords.includes(segment.keyword));
|
|
126
247
|
const currentText = current !== undefined ? String(current.value) : undefined;
|
|
127
248
|
const currentLabel = current !== undefined
|
|
128
|
-
? `${String(current.value)} (${current.source
|
|
129
|
-
: '
|
|
249
|
+
? `${optionLabel(String(current.value), t)} (${sourceLabel(current.source, t)})`
|
|
250
|
+
: optionLabel(KEYWORD_DEFAULTS[key] ?? '', t) || t('style.default');
|
|
130
251
|
const remaining = segments === undefined
|
|
131
252
|
? keywords
|
|
132
253
|
: keywords.filter((keyword) => !segments.some((segment) => segment.keyword === keyword));
|
|
133
|
-
body = (_jsxs("div", { className: "bd-style-enum", "data-segmented": segments !== undefined ? '' : undefined, children: [segments !== undefined ? (_jsx(SegmentedControl, { label: label, value: currentText, disabled: props.disabled, options: segments.map((segment) => ({
|
|
254
|
+
body = (_jsxs("div", { className: "bd-style-enum", "data-segmented": segments !== undefined ? '' : undefined, "data-more": segments !== undefined && remaining.length > 0 ? '' : undefined, children: [segments !== undefined ? (_jsx(SegmentedControl, { label: label, value: currentText, disabled: props.disabled, options: segments.map((segment) => ({
|
|
134
255
|
value: segment.keyword,
|
|
135
|
-
label: segment.
|
|
256
|
+
label: segment.labelKey !== undefined
|
|
257
|
+
? t(segment.labelKey)
|
|
258
|
+
: optionLabel(segment.keyword, t),
|
|
136
259
|
...(segment.icon !== undefined ? { icon: segment.icon } : {}),
|
|
137
260
|
iconOnly: segment.icon !== undefined,
|
|
138
261
|
})), onValueChange: (keyword) => current?.source === layer && currentText === keyword ? unset() : set(keyword) })) : null, remaining.length > 0 ? (_jsxs("select", { id: id, className: "bd-input", "aria-label": segments !== undefined ? `${label}: ${t('style.more')}` : undefined, value: current?.source === layer && remaining.includes(String(current.value))
|
|
139
262
|
? String(current.value)
|
|
140
|
-
: '', disabled: props.disabled, onChange: (event) => (event.target.value === '' ? unset() : set(event.target.value)), children: [_jsx("option", { value: "", children: segments !== undefined ? '
|
|
263
|
+
: '', disabled: props.disabled, onChange: (event) => (event.target.value === '' ? unset() : set(event.target.value)), children: [_jsx("option", { value: "", children: segments !== undefined ? t('style.more.short') : currentLabel }), remaining.map((keyword) => (_jsx("option", { value: keyword, children: optionLabel(keyword, t) }, keyword)))] })) : null] }));
|
|
141
264
|
if (segments === undefined) {
|
|
142
|
-
title = (_jsx("label", { htmlFor: id, className: "bd-field-label", children:
|
|
265
|
+
title = (_jsx("label", { htmlFor: id, className: "bd-field-label", children: shownLabel }));
|
|
143
266
|
}
|
|
144
267
|
}
|
|
145
268
|
else {
|
|
146
|
-
title = (_jsx(
|
|
147
|
-
|
|
269
|
+
title = isNumeric(def) ? (_jsx(ScrubLabel, { htmlFor: id, value: String(effective[key]?.value ?? ''), step: stepOf(def), ...boundsOf(def, String(effective[key]?.value ?? '')), unit: takesNumber(def) ? '' : (unitsOf(def)[0] ?? ''), disabled: props.disabled, onValueChange: (text) => {
|
|
270
|
+
const checked = checkStyleInput(def, text, props.theme);
|
|
271
|
+
if (checked.ok)
|
|
272
|
+
set(checked.value);
|
|
273
|
+
}, children: shownLabel })) : (_jsx("label", { htmlFor: id, className: "bd-field-label", children: shownLabel }));
|
|
274
|
+
body = (_jsx(ValueField, { ...base, keywords: keywords, hint: props.hints?.[def.name], inputId: id, path: pathOf(def), label: label, hideLabel: true, onSet: (value) => set(value), onUnset: () => unset() }));
|
|
148
275
|
}
|
|
149
|
-
return (_jsxs("div", { className: `bd-field bd-style-field${props.inline === true ? ' bd-style-inline' : ''}`, "data-style-prop": key, "data-origin": origin, children: [head(title), body] }))
|
|
276
|
+
return (_jsxs("div", { className: `bd-field bd-style-field${props.inline === true ? ' bd-style-inline' : ''}`, "data-style-prop": key, "data-origin": origin, children: [head(title), key === 'effects.shadow' ? null : body, key === 'background.imagePosition' ? (_jsx(AlignmentPad, { value: String(effective[key]?.value ?? 'center'), disabled: props.disabled, label: label, onPick: set })) : null, key === 'effects.shadow' ? (_jsx(ShadowEditor, { layers: false, theme: props.theme, value: String(effective[key]?.value ?? 'none'), disabled: props.disabled, onPick: (value) => {
|
|
277
|
+
store.transaction(label, () => {
|
|
278
|
+
for (const property of Object.keys(SHADOW)) {
|
|
279
|
+
const result = store.dispatch({
|
|
280
|
+
type: 'node.unsetStyle',
|
|
281
|
+
payload: { id: nodeId, layer: layerObject, group: 'effects', property },
|
|
282
|
+
});
|
|
283
|
+
if (!result.ok)
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
return setOne(value).ok;
|
|
287
|
+
});
|
|
288
|
+
}, onCustom:
|
|
289
|
+
// Only when the property stores a custom shadow; today it takes tokens and `none`.
|
|
290
|
+
checkStyleInput(def, '0px 4px 12px 0px #00000026', props.theme).ok
|
|
291
|
+
? (text) => {
|
|
292
|
+
const checked = checkStyleInput(def, text, props.theme);
|
|
293
|
+
if (checked.ok)
|
|
294
|
+
set(checked.value);
|
|
295
|
+
}
|
|
296
|
+
: undefined })) : null] }));
|
|
150
297
|
}
|
|
151
298
|
/**
|
|
152
299
|
* The Style tab (docs/editor.md#the-style-inspector): the style groups the component allows, each
|
|
@@ -154,30 +301,232 @@ function StyleProperty(props) {
|
|
|
154
301
|
* the theme before anything is dispatched, so a value outside the grammar cannot be written; a value
|
|
155
302
|
* that comes from a wider breakpoint is shown as such, and "Reset" removes only this layer's key.
|
|
156
303
|
*/
|
|
157
|
-
export function StyleInspector({ node, breakpoint, theme = defaultTheme }) {
|
|
304
|
+
export function StyleInspector({ node, breakpoint, theme = defaultTheme, query, }) {
|
|
305
|
+
return (_jsx(SelectedStyleInspector, { node: node, ...(breakpoint !== undefined ? { breakpoint } : {}), theme: theme, ...(query !== undefined ? { query } : {}) }, node.id));
|
|
306
|
+
}
|
|
307
|
+
function SelectedStyleInspector({ node, breakpoint, theme = defaultTheme, query = '', }) {
|
|
158
308
|
const t = useT();
|
|
159
309
|
const manifest = useManifest();
|
|
160
310
|
const doc = useEditorState((state) => state.doc);
|
|
161
311
|
const readOnly = useEditorState((state) => state.readOnly);
|
|
162
312
|
const [notice, setNotice] = useState('');
|
|
163
|
-
const
|
|
313
|
+
const [state, setState] = useState('normal');
|
|
314
|
+
const device = breakpoint ?? 'base';
|
|
315
|
+
const layer = state === 'normal' ? device : `state:${state}`;
|
|
164
316
|
const meta = componentMeta(manifest, node.type);
|
|
165
317
|
const disabled = readOnly || !canEdit(doc, createIndex(doc), node.id, 'style').ok;
|
|
166
|
-
const
|
|
318
|
+
const baseEffective = effectiveStyles(node.styles ?? {}, device, theme.breakpoints);
|
|
319
|
+
const stateDecl = state === 'normal' ? undefined : node.styles?.state?.[state];
|
|
320
|
+
const stateEffective = stateDecl === undefined ? {} : effectiveStyles({ base: stateDecl }, 'base', theme.breakpoints);
|
|
321
|
+
const effective = state === 'normal'
|
|
322
|
+
? baseEffective
|
|
323
|
+
: {
|
|
324
|
+
...baseEffective,
|
|
325
|
+
...Object.fromEntries(Object.entries(stateEffective).map(([path, entry]) => [
|
|
326
|
+
path,
|
|
327
|
+
{ ...entry, source: layer },
|
|
328
|
+
])),
|
|
329
|
+
};
|
|
167
330
|
const groups = STYLE_GROUPS.filter((group) => meta?.styles.groups.includes(group));
|
|
331
|
+
// For a container the display is a component prop, not a style: read the effective one.
|
|
332
|
+
const displayDef = meta?.props['display'];
|
|
333
|
+
const displayReading = displayDef === undefined
|
|
334
|
+
? undefined
|
|
335
|
+
: readProp(node, 'display', displayDef, undefined, undefined);
|
|
336
|
+
const fallbackDisplay = displayReading?.mode === 'static' && typeof displayReading.value === 'string'
|
|
337
|
+
? displayReading.value
|
|
338
|
+
: typeof displayDef?.default === 'string'
|
|
339
|
+
? displayDef.default
|
|
340
|
+
: undefined;
|
|
168
341
|
if (groups.length === 0) {
|
|
169
342
|
return _jsx("p", { className: "bd-inspector-empty", children: t('style.none') });
|
|
170
343
|
}
|
|
171
|
-
const knownLayer =
|
|
172
|
-
|
|
344
|
+
const knownLayer = device === 'base' || theme.breakpoints.some((b) => b.id === device);
|
|
345
|
+
const maxWidth = theme.breakpoints.find((b) => b.id === device)?.maxWidth;
|
|
346
|
+
const deviceName = device === 'tablet' || device === 'mobile'
|
|
347
|
+
? t(`inspector.device.${device}`)
|
|
348
|
+
: device;
|
|
349
|
+
const needle = query.trim().toLocaleLowerCase();
|
|
350
|
+
const searching = needle !== '';
|
|
351
|
+
const anyMatch = groups.some((group) => (group === 'typography'
|
|
352
|
+
? `${t('style.group.typography')} ${t('style.section.colors')}`
|
|
353
|
+
: group === 'effects'
|
|
354
|
+
? `${t('style.group.effects')} ${t('style.section.shadow')}`
|
|
355
|
+
: group === 'border'
|
|
356
|
+
? t('style.section.border')
|
|
357
|
+
: t(`style.group.${group}`))
|
|
358
|
+
.toLocaleLowerCase()
|
|
359
|
+
.includes(needle) ||
|
|
360
|
+
propertiesOfGroup(group).some((def) => propertyLabel(def, t).toLocaleLowerCase().includes(needle)));
|
|
361
|
+
return (_jsxs("div", { className: "bd-styles", "data-layer": layer, children: [_jsx(SegmentedControl, { label: t('style.state.label'), value: state, options: [
|
|
362
|
+
{ value: 'normal', label: t('style.state.normal') },
|
|
363
|
+
{ value: 'hover', label: t('style.state.hover') },
|
|
364
|
+
{ value: 'focus-visible', label: t('style.state.focus-visible') },
|
|
365
|
+
{ value: 'active', label: t('style.state.active') },
|
|
366
|
+
], onValueChange: (value) => {
|
|
367
|
+
if (value === 'normal' ||
|
|
368
|
+
value === 'hover' ||
|
|
369
|
+
value === 'focus-visible' ||
|
|
370
|
+
value === 'active')
|
|
371
|
+
setState(value);
|
|
372
|
+
} }), state !== 'normal' ? (_jsxs("div", { className: "bd-note bd-note--info bd-styles-layer", role: "status", children: [_jsx(Icon, { name: "monitor" }), _jsx("span", { children: `${t('style.editing')}: ${t(`style.state.${state}`)}` })] })) : device !== 'base' ? (_jsxs("div", { className: "bd-note bd-note--ovr bd-styles-layer", "data-override": "true", role: "status", children: [_jsx(Icon, { name: device === 'mobile'
|
|
373
|
+
? 'smartphone'
|
|
374
|
+
: device === 'tablet'
|
|
375
|
+
? 'tablet'
|
|
376
|
+
: 'monitor-smartphone' }), _jsxs("span", { children: [t('inspector.device.editing'), " ", _jsx("b", { children: deviceName }), maxWidth === undefined ? '' : ` (≤ ${maxWidth}px)`, ". ", t('inspector.device.hint')] })] })) : null, !knownLayer ? _jsx("p", { className: "bd-style-error", children: t('style.unknownBreakpoint') }) : null, searching && !anyMatch ? (_jsxs("div", { className: "bd-empty", role: "status", children: [_jsx("strong", { children: interpolate(t('inspector.search.noMatch'), { query: query.trim() }) }), _jsx("span", { children: t('inspector.search.hint') })] })) : null, groups.flatMap((group) => {
|
|
377
|
+
const common = {
|
|
378
|
+
group,
|
|
379
|
+
fallbackDisplay,
|
|
380
|
+
node,
|
|
381
|
+
meta,
|
|
382
|
+
nodeId: node.id,
|
|
383
|
+
effective,
|
|
384
|
+
layer,
|
|
385
|
+
theme,
|
|
386
|
+
disabled: disabled || !knownLayer,
|
|
387
|
+
onError: setNotice,
|
|
388
|
+
query: query.trim().toLocaleLowerCase(),
|
|
389
|
+
};
|
|
390
|
+
return [
|
|
391
|
+
...(group === 'effects'
|
|
392
|
+
? [_jsx(StyleGroupSection, { ...common, section: "shadow" }, "shadow")]
|
|
393
|
+
: []),
|
|
394
|
+
_jsx(StyleGroupSection, { ...common }, group),
|
|
395
|
+
...(group === 'typography'
|
|
396
|
+
? [_jsx(StyleGroupSection, { ...common, section: "colors" }, "colors")]
|
|
397
|
+
: []),
|
|
398
|
+
];
|
|
399
|
+
}), _jsx("div", { role: "status", className: "bd-inspector-notice", children: notice })] }));
|
|
173
400
|
}
|
|
174
401
|
function StyleGroupSection(props) {
|
|
175
402
|
const t = useT();
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
403
|
+
const section = props.section ?? props.group;
|
|
404
|
+
const sectionLabel = props.section !== undefined
|
|
405
|
+
? t(`style.section.${props.section}`)
|
|
406
|
+
: props.group === 'border'
|
|
407
|
+
? t('style.section.border')
|
|
408
|
+
: t(`style.group.${props.group}`);
|
|
409
|
+
const store = useEditor();
|
|
410
|
+
const [moreDims, setMoreDims] = useState(false);
|
|
411
|
+
// The media of a background are component props (an image and a video), found by their shape.
|
|
412
|
+
const support = backgroundMediaSupport(props.meta);
|
|
413
|
+
const videoSet = props.node !== undefined && hasMedia(props.node, 'backgroundVideo');
|
|
414
|
+
const imageSet = props.node !== undefined && hasMedia(props.node, 'backgroundImage');
|
|
415
|
+
const [chosenMode, setBackgroundMode] = useState(props.effective['background.gradient'] !== undefined ? 'gradient' : 'color');
|
|
416
|
+
// A value the component already holds decides the mode (also after Undo brings one back).
|
|
417
|
+
// Media belong to the whole component, so only the base layer lets them decide.
|
|
418
|
+
const backgroundMode = props.layer !== 'base'
|
|
419
|
+
? chosenMode
|
|
420
|
+
: support.video && videoSet
|
|
421
|
+
? 'video'
|
|
422
|
+
: support.image && imageSet
|
|
423
|
+
? 'image'
|
|
424
|
+
: chosenMode;
|
|
425
|
+
// Media props belong to the whole component, not to one device or state.
|
|
426
|
+
const mediaEditable = !props.disabled && props.layer === 'base';
|
|
427
|
+
const chooseBackground = (kind) => {
|
|
428
|
+
setBackgroundMode(kind);
|
|
429
|
+
const node = props.node;
|
|
430
|
+
const clear = node === undefined || props.layer !== 'base'
|
|
431
|
+
? []
|
|
432
|
+
: mediaToClear(kind).filter((name) => hasMedia(node, name));
|
|
433
|
+
if (kind !== 'none' && clear.length === 0)
|
|
434
|
+
return;
|
|
435
|
+
// Switching the kind removes the media the new kind does not keep: one undo step.
|
|
436
|
+
const done = store.transaction(sectionLabel, () => {
|
|
437
|
+
if (kind === 'none') {
|
|
438
|
+
for (const property of ['color', 'gradient']) {
|
|
439
|
+
const result = store.dispatch({
|
|
440
|
+
type: 'node.unsetStyle',
|
|
441
|
+
payload: {
|
|
442
|
+
id: props.nodeId,
|
|
443
|
+
layer: layerFor(props.layer),
|
|
444
|
+
group: 'background',
|
|
445
|
+
property,
|
|
446
|
+
},
|
|
447
|
+
});
|
|
448
|
+
if (!result.ok)
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
for (const prop of clear) {
|
|
453
|
+
const result = store.dispatch({
|
|
454
|
+
type: 'node.unsetProp',
|
|
455
|
+
payload: { id: props.nodeId, prop },
|
|
456
|
+
});
|
|
457
|
+
if (!result.ok)
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
return true;
|
|
461
|
+
});
|
|
462
|
+
if (!done)
|
|
463
|
+
props.onError(t('style.media.switchFailed'));
|
|
464
|
+
};
|
|
465
|
+
// Every property of the section, whatever the search says: "Reset section" and the counts use it.
|
|
466
|
+
const sectionDefs = propertiesOfGroup(props.group).filter((def) => getStyleProperty(def.group, def.name) !== undefined &&
|
|
467
|
+
(!props.layer.startsWith('state:') || def.allowInStates) &&
|
|
468
|
+
(props.group !== 'typography' ||
|
|
469
|
+
(props.section === 'colors' ? def.name === 'color' : def.name !== 'color')) &&
|
|
470
|
+
(props.group !== 'effects' ||
|
|
471
|
+
(props.section === 'shadow' ? /shadow/i.test(def.name) : !/shadow/i.test(def.name))));
|
|
472
|
+
const matching = sectionDefs.filter((def) => props.query === '' ||
|
|
473
|
+
sectionLabel.toLocaleLowerCase().includes(props.query) ||
|
|
474
|
+
propertyLabel(def, t).toLocaleLowerCase().includes(props.query));
|
|
475
|
+
const relevant = Object.entries(props.effective).filter(([path]) => sectionDefs.some((def) => path === pathOf(def) || path.startsWith(`${pathOf(def)}.`)));
|
|
476
|
+
const used = relevant.length > 0;
|
|
477
|
+
// Min. and max. dimensions sit behind a disclosure until one has a value or the search finds it.
|
|
478
|
+
const isLimit = (def) => props.group === 'size' && /^(min|max)(Width|Height)$/.test(def.name);
|
|
479
|
+
const limitUsed = sectionDefs.some((def) => isLimit(def) &&
|
|
480
|
+
Object.keys(props.effective).some((path) => path.startsWith(`${pathOf(def)}`)));
|
|
481
|
+
const showLimits = moreDims || limitUsed || props.query !== '';
|
|
482
|
+
const shadowFirst = (a, b) => Number(b.name === 'shadow') - Number(a.name === 'shadow');
|
|
483
|
+
const defs = matching
|
|
484
|
+
.filter((def) => (!isLimit(def) || showLimits) &&
|
|
485
|
+
(props.group !== 'background' ||
|
|
486
|
+
props.query !== '' ||
|
|
487
|
+
(backgroundMode === 'none' || backgroundMode === 'image' || backgroundMode === 'video'
|
|
488
|
+
? false
|
|
489
|
+
: backgroundMode === 'color'
|
|
490
|
+
? def.name === 'color'
|
|
491
|
+
: def.name !== 'color')))
|
|
492
|
+
.sort(props.section === 'shadow' ? shadowFirst : () => 0);
|
|
493
|
+
// Why Image and Video are off: the component has no such background, or a device is being edited.
|
|
494
|
+
const mediaHint = !support.image && !support.video
|
|
495
|
+
? t('style.media.unsupported')
|
|
496
|
+
: props.layer !== 'base'
|
|
497
|
+
? t('style.media.baseOnly')
|
|
498
|
+
: undefined;
|
|
499
|
+
const hasLimits = props.query === '' && sectionDefs.some(isLimit);
|
|
500
|
+
/** Paths written at the layer being edited: what "Reset section" removes. */
|
|
501
|
+
const here = sectionDefs.flatMap((def) => {
|
|
502
|
+
const parts = partsOf(def);
|
|
503
|
+
return (parts.length > 0 ? parts.map((part) => ({ def, part })) : [{ def, part: undefined }])
|
|
504
|
+
.filter(({ part }) => props.effective[pathOf(def, part)]?.source === props.layer)
|
|
505
|
+
.map(({ part }) => ({ def, part }));
|
|
506
|
+
});
|
|
507
|
+
const isBreakpoint = props.layer !== 'base' && !props.layer.startsWith('state:');
|
|
508
|
+
const resetSection = () => {
|
|
509
|
+
let failure = '';
|
|
510
|
+
// The same command as the per-property reset, one undo step for the whole section.
|
|
511
|
+
store.transaction(sectionLabel, () => {
|
|
512
|
+
for (const { def, part } of here) {
|
|
513
|
+
const result = store.dispatch({
|
|
514
|
+
type: 'node.unsetStyle',
|
|
515
|
+
payload: {
|
|
516
|
+
id: props.nodeId,
|
|
517
|
+
layer: layerFor(props.layer),
|
|
518
|
+
group: def.group,
|
|
519
|
+
property: def.name,
|
|
520
|
+
...(part !== undefined ? { side: part } : {}),
|
|
521
|
+
},
|
|
522
|
+
});
|
|
523
|
+
if (!result.ok)
|
|
524
|
+
failure ||= result.error?.message ?? '';
|
|
525
|
+
}
|
|
526
|
+
return failure === '';
|
|
527
|
+
});
|
|
528
|
+
props.onError(failure);
|
|
529
|
+
};
|
|
181
530
|
const byName = new Map(defs.map((def) => [def.name, def]));
|
|
182
531
|
const common = {
|
|
183
532
|
nodeId: props.nodeId,
|
|
@@ -186,6 +535,7 @@ function StyleGroupSection(props) {
|
|
|
186
535
|
theme: props.theme,
|
|
187
536
|
disabled: props.disabled,
|
|
188
537
|
onError: props.onError,
|
|
538
|
+
query: props.query,
|
|
189
539
|
};
|
|
190
540
|
// Margin wraps padding as a ring (the way the page nests them); pairs share one row.
|
|
191
541
|
const nested = props.group === 'spacing' && byName.has('margin') && byName.has('padding');
|
|
@@ -198,14 +548,24 @@ function StyleGroupSection(props) {
|
|
|
198
548
|
}
|
|
199
549
|
const seconds = new Set([...paired.values()].map((def) => def.name));
|
|
200
550
|
const rows = [];
|
|
201
|
-
|
|
551
|
+
const structured = props.query === '' && props.group === 'effects';
|
|
552
|
+
if (structured)
|
|
553
|
+
rows.push(...structuredEffectRows({ ...props, byName, common, t }));
|
|
554
|
+
const motion = props.query === '' && props.group === 'motion';
|
|
555
|
+
if (motion) {
|
|
556
|
+
rows.push(_jsx(MotionRows, { nodeId: props.nodeId, effective: props.effective, layer: props.layer, disabled: props.disabled, onError: props.onError, has: (name) => byName.has(name), row: (name) => {
|
|
557
|
+
const def = byName.get(name);
|
|
558
|
+
return def === undefined ? null : _jsx(StyleProperty, { def: def, inline: true, ...common });
|
|
559
|
+
} }, "motion"));
|
|
560
|
+
}
|
|
561
|
+
for (const def of structured || motion ? [] : defs) {
|
|
202
562
|
if (seconds.has(def.name))
|
|
203
563
|
continue;
|
|
204
564
|
if (nested && def.name === 'padding')
|
|
205
565
|
continue;
|
|
206
566
|
if (nested && def.name === 'margin') {
|
|
207
567
|
const padding = (_jsx(StyleProperty, { def: byName.get('padding'), ring: true, ...common }));
|
|
208
|
-
rows.push(_jsx(
|
|
568
|
+
rows.push(_jsx(BoxModel, { children: _jsx(StyleProperty, { def: def, ring: true, ...common, children: padding }) }, "box-model"));
|
|
209
569
|
continue;
|
|
210
570
|
}
|
|
211
571
|
const second = paired.get(def.name);
|
|
@@ -213,7 +573,215 @@ function StyleGroupSection(props) {
|
|
|
213
573
|
rows.push(_jsxs("div", { className: "bd-style-pair", children: [_jsx(StyleProperty, { def: def, ...common }), _jsx(StyleProperty, { def: second, ...common })] }, def.name));
|
|
214
574
|
continue;
|
|
215
575
|
}
|
|
216
|
-
|
|
576
|
+
if (props.group === 'layout' &&
|
|
577
|
+
[
|
|
578
|
+
'justify',
|
|
579
|
+
'align',
|
|
580
|
+
'rowGap',
|
|
581
|
+
'columnGap',
|
|
582
|
+
'order',
|
|
583
|
+
'zIndex',
|
|
584
|
+
'columnSpan',
|
|
585
|
+
'position',
|
|
586
|
+
'inset',
|
|
587
|
+
].includes(def.name) &&
|
|
588
|
+
props.query === '') {
|
|
589
|
+
rows.push(_jsx(LayoutMore, { label: propertyLabel(def, t), children: _jsx(StyleProperty, { def: def, inline: true, ...common }) }, def.name));
|
|
590
|
+
}
|
|
591
|
+
else
|
|
592
|
+
rows.push(_jsx(StyleProperty, { def: def, inline: true, ...common }, def.name));
|
|
593
|
+
if (props.group === 'layout' && def.name === 'direction' && props.query === '')
|
|
594
|
+
rows.push(_jsx(LayoutAlignment, { ...common, fallbackDisplay: props.fallbackDisplay }, "alignment"));
|
|
595
|
+
}
|
|
596
|
+
if (matching.length === 0)
|
|
597
|
+
return null;
|
|
598
|
+
return (_jsxs(StyleSection, { name: section, label: sectionLabel, defaultOpen: section === 'colors' || props.group === 'spacing', searching: props.query !== '', modified: used, override: isBreakpoint && here.length > 0, overrideCount: isBreakpoint ? here.length : 0, layer: props.layer, query: props.query, onReset: here.length > 0 ? resetSection : undefined, resetDisabled: props.disabled, children: [props.group === 'background' && props.query === '' ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "bd-field-label", children: t('styleField.bg.type') }), _jsx("fieldset", { className: "bd-segmented bd-bg-kind", "aria-label": t('styleField.bg.type'), children: [
|
|
599
|
+
['none', t('styleField.bg.noneShort')],
|
|
600
|
+
['color', t('styleField.bg.color')],
|
|
601
|
+
['gradient', t('styleField.bg.gradient')],
|
|
602
|
+
['image', t('style.media.image')],
|
|
603
|
+
['video', t('style.media.video')],
|
|
604
|
+
].map(([kind, text]) => {
|
|
605
|
+
const media = kind === 'image' || kind === 'video';
|
|
606
|
+
const offered = kind === 'image' ? support.image : support.video;
|
|
607
|
+
const blocked = media && (!offered || props.layer !== 'base');
|
|
608
|
+
const button = (_jsx(Button, { variant: "ghost", className: "bd-segment", "aria-pressed": backgroundMode === kind, disabled: props.disabled || blocked, onClick: () => chooseBackground(kind), children: text }, kind));
|
|
609
|
+
return blocked ? (_jsx(Tooltip, { content: t(offered ? 'style.media.baseOnly' : 'style.media.unsupported'), children: _jsx("span", { className: "bd-bg-kind__disabled", children: button }) }, kind)) : (button);
|
|
610
|
+
}) }), mediaHint !== undefined ? _jsx("p", { className: "bd-hint", children: mediaHint }) : null, (backgroundMode === 'image' || backgroundMode === 'video') &&
|
|
611
|
+
props.node !== undefined &&
|
|
612
|
+
props.meta !== undefined ? (_jsx(BackgroundMediaFields, { node: props.node, meta: props.meta, mode: backgroundMode, disabled: !mediaEditable, onError: props.onError })) : null] })) : null, rows, hasLimits ? (_jsxs("button", { type: "button", className: "bd-textbtn bd-more-dims", "aria-expanded": showLimits, disabled: limitUsed, onClick: () => setMoreDims(!moreDims), children: [_jsx(Icon, { name: showLimits ? 'chevron-up' : 'chevron-down' }), showLimits ? t('styleField.dimensions.fewer') : t('styleField.dimensions.more')] })) : null] }));
|
|
613
|
+
}
|
|
614
|
+
const SHADOW_GEOMETRY = [
|
|
615
|
+
'shadowX',
|
|
616
|
+
'shadowY',
|
|
617
|
+
'shadowBlur',
|
|
618
|
+
'shadowSpread',
|
|
619
|
+
'shadowColor',
|
|
620
|
+
'shadowInset',
|
|
621
|
+
];
|
|
622
|
+
const TEXT_SHADOW_ROWS = ['textShadowX', 'textShadowY', 'textShadowBlur', 'textShadowColor'];
|
|
623
|
+
/** The effects, grouped the way the template groups them; the second list sits behind a disclosure. */
|
|
624
|
+
const EFFECT_GROUPS = [
|
|
625
|
+
{ main: ['opacity', 'blur', 'blendMode'] },
|
|
626
|
+
{
|
|
627
|
+
title: 'styleField.effects.filters',
|
|
628
|
+
main: ['brightness', 'contrast', 'saturate'],
|
|
629
|
+
more: {
|
|
630
|
+
label: 'styleField.effects.moreFilters',
|
|
631
|
+
names: ['grayscale', 'sepia', 'hueRotate', 'invert', 'backdropBlur'],
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
title: 'styleField.effects.transforms',
|
|
636
|
+
main: ['rotate', 'scale', 'translateX', 'translateY'],
|
|
637
|
+
more: {
|
|
638
|
+
label: 'styleField.effects.moreTransforms',
|
|
639
|
+
names: ['skewX', 'skewY', 'transformOrigin'],
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
];
|
|
643
|
+
/**
|
|
644
|
+
* The first layer of the shadow the property shows (a theme preset), as the geometry values the
|
|
645
|
+
* sliders start from. Only text the grammar accepts is used, so a preset the grammar cannot
|
|
646
|
+
* express in parts simply leaves the sliders at their defaults.
|
|
647
|
+
*/
|
|
648
|
+
function shadowSeed(theme, value, defs) {
|
|
649
|
+
const layer = shadowLayers(theme, value)[0];
|
|
650
|
+
if (layer === undefined)
|
|
651
|
+
return {};
|
|
652
|
+
const wanted = {
|
|
653
|
+
shadowX: layer.x,
|
|
654
|
+
shadowY: layer.y,
|
|
655
|
+
shadowBlur: layer.blur,
|
|
656
|
+
shadowSpread: layer.spread,
|
|
657
|
+
shadowColor: layer.color,
|
|
658
|
+
shadowInset: layer.inset ? 'inset' : 'outset',
|
|
659
|
+
};
|
|
660
|
+
const out = {};
|
|
661
|
+
for (const [name, text] of Object.entries(wanted)) {
|
|
662
|
+
const def = defs.get(name);
|
|
663
|
+
if (def !== undefined && checkStyleInput(def, text, theme).ok)
|
|
664
|
+
out[name] = text;
|
|
665
|
+
}
|
|
666
|
+
return out;
|
|
667
|
+
}
|
|
668
|
+
/** The shadow and effects sections: ready shadows first, geometry only for a shadow, extras folded. */
|
|
669
|
+
function structuredEffectRows(props) {
|
|
670
|
+
const { byName, common, effective, t } = props;
|
|
671
|
+
const used = (names) => names.some((name) => effective[`effects.${name}`] !== undefined);
|
|
672
|
+
const row = (name, hints, inline = true) => {
|
|
673
|
+
const def = byName.get(name);
|
|
674
|
+
return def === undefined ? null : (_jsx(StyleProperty, { def: def, inline: inline, ...common, ...(hints !== undefined ? { hints } : {}) }, name));
|
|
675
|
+
};
|
|
676
|
+
const sub = (key, label) => (_jsx("span", { className: "bd-flabel bd-style-sub", children: label }, key));
|
|
677
|
+
const rows = [];
|
|
678
|
+
if (props.section === 'shadow') {
|
|
679
|
+
const value = String(effective['effects.shadow']?.value ?? 'none');
|
|
680
|
+
const custom = used(SHADOW_GEOMETRY);
|
|
681
|
+
const seed = shadowSeed(props.theme, value, byName);
|
|
682
|
+
rows.push(row('shadow', seed, false));
|
|
683
|
+
if (custom || value !== 'none') {
|
|
684
|
+
rows.push(sub('adjust', t(custom ? 'styleField.shadow.custom' : 'styleField.shadow.adjust')));
|
|
685
|
+
for (const name of SHADOW_GEOMETRY)
|
|
686
|
+
rows.push(row(name, seed));
|
|
687
|
+
}
|
|
688
|
+
if (TEXT_SHADOW_ROWS.some((name) => byName.has(name))) {
|
|
689
|
+
rows.push(_jsx(Disclosure, { label: t('styleField.shadow.text'), defaultOpen: used(TEXT_SHADOW_ROWS), children: TEXT_SHADOW_ROWS.map((name) => row(name)) }, "text-shadow"));
|
|
690
|
+
}
|
|
691
|
+
return rows;
|
|
217
692
|
}
|
|
218
|
-
|
|
693
|
+
const listed = new Set(['transition', 'cursor']);
|
|
694
|
+
for (const group of EFFECT_GROUPS) {
|
|
695
|
+
for (const name of [...group.main, ...(group.more?.names ?? [])])
|
|
696
|
+
listed.add(name);
|
|
697
|
+
}
|
|
698
|
+
for (const group of EFFECT_GROUPS) {
|
|
699
|
+
if (group.title !== undefined)
|
|
700
|
+
rows.push(sub(group.title, t(group.title)));
|
|
701
|
+
for (const name of group.main)
|
|
702
|
+
rows.push(row(name));
|
|
703
|
+
const more = group.more;
|
|
704
|
+
if (more !== undefined && more.names.some((name) => byName.has(name))) {
|
|
705
|
+
rows.push(_jsx(Disclosure, { label: t(more.label), defaultOpen: used(more.names), children: more.names.map((name) => row(name)) }, more.label));
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
const rest = ['transition', 'cursor', ...[...byName.keys()].filter((name) => !listed.has(name))];
|
|
709
|
+
if (rest.some((name) => byName.has(name))) {
|
|
710
|
+
rows.push(_jsx(Disclosure, { label: t('styleField.effects.advanced'), defaultOpen: used(rest), children: rest.map((name) => row(name)) }, "advanced"));
|
|
711
|
+
}
|
|
712
|
+
return rows;
|
|
713
|
+
}
|
|
714
|
+
/** A closed-by-default group of rows behind a button with `aria-expanded`; open while any holds a value. */
|
|
715
|
+
function Disclosure(props) {
|
|
716
|
+
const [open, setOpen] = useState(props.defaultOpen);
|
|
717
|
+
const id = useId();
|
|
718
|
+
return (_jsxs("div", { className: "bd-layout-more", "data-open": open, children: [_jsxs("button", { type: "button", className: "bd-layout-more__toggle", "aria-expanded": open, "aria-controls": id, onClick: () => setOpen(!open), children: [_jsx(Icon, { name: open ? 'chevron-down' : 'chevron-right' }), props.label] }), _jsx("div", { id: id, className: "bd-disclosure__body", hidden: !open, children: props.children })] }));
|
|
719
|
+
}
|
|
720
|
+
/** A closed-by-default row (a button with `aria-expanded`, not `<details>`) for the rarely used layout properties. */
|
|
721
|
+
function LayoutMore(props) {
|
|
722
|
+
const [open, setOpen] = useState(false);
|
|
723
|
+
const id = useId();
|
|
724
|
+
return (_jsxs("div", { className: "bd-layout-more", "data-open": open, children: [_jsxs("button", { type: "button", className: "bd-layout-more__toggle", "aria-expanded": open, "aria-controls": id, onClick: () => setOpen(!open), children: [_jsx(Icon, { name: open ? 'chevron-down' : 'chevron-right' }), props.label] }), _jsx("div", { id: id, hidden: !open, children: props.children })] }));
|
|
725
|
+
}
|
|
726
|
+
/** The pad is a shortcut for the same two layout commands as the individual segments. */
|
|
727
|
+
function LayoutAlignment(props) {
|
|
728
|
+
const t = useT();
|
|
729
|
+
const store = useEditor();
|
|
730
|
+
const display = props.effective['layout.display']?.value ?? props.fallbackDisplay;
|
|
731
|
+
if (display !== 'flex' && display !== 'inline-flex')
|
|
732
|
+
return null;
|
|
733
|
+
const direction = String(props.effective['layout.direction']?.value ?? 'row');
|
|
734
|
+
const column = direction.startsWith('column');
|
|
735
|
+
const reverse = direction.endsWith('reverse');
|
|
736
|
+
const values = ['flex-start', 'center', 'flex-end'];
|
|
737
|
+
const main = String(props.effective['layout.justify']?.value ?? 'flex-start');
|
|
738
|
+
const cross = String(props.effective['layout.align']?.value ?? 'stretch');
|
|
739
|
+
const at = (value) => values.indexOf(value === 'start' ? 'flex-start' : value === 'end' ? 'flex-end' : value);
|
|
740
|
+
const mainIndex = at(main);
|
|
741
|
+
const crossIndex = at(cross);
|
|
742
|
+
const j = reverse && mainIndex !== -1 ? 2 - mainIndex : mainIndex;
|
|
743
|
+
const x = column ? crossIndex : j;
|
|
744
|
+
const y = column ? j : crossIndex;
|
|
745
|
+
const positions = [
|
|
746
|
+
'top left',
|
|
747
|
+
'top',
|
|
748
|
+
'top right',
|
|
749
|
+
'left',
|
|
750
|
+
'center',
|
|
751
|
+
'right',
|
|
752
|
+
'bottom left',
|
|
753
|
+
'bottom',
|
|
754
|
+
'bottom right',
|
|
755
|
+
];
|
|
756
|
+
return (_jsxs("div", { className: "bd-layout-alignment", children: [_jsx("span", { className: "bd-field-label", children: t('style.alignment') }), _jsx(AlignmentPad, { column: column, hint: t(column ? 'styleField.align.helpColumn' : 'styleField.align.helpRow'), label: t('style.alignment'), value: x < 0 || y < 0 ? '' : (positions[y * 3 + x] ?? ''), disabled: props.disabled, onPick: (position) => {
|
|
757
|
+
const index = positions.indexOf(position);
|
|
758
|
+
if (index < 0)
|
|
759
|
+
return;
|
|
760
|
+
const row = Math.floor(index / 3);
|
|
761
|
+
const col = index % 3;
|
|
762
|
+
const mainAxis = column ? row : col;
|
|
763
|
+
const result = store.dispatchBatch([
|
|
764
|
+
{
|
|
765
|
+
type: 'node.setStyle',
|
|
766
|
+
payload: {
|
|
767
|
+
id: props.nodeId,
|
|
768
|
+
layer: layerFor(props.layer),
|
|
769
|
+
group: 'layout',
|
|
770
|
+
property: 'justify',
|
|
771
|
+
value: values[reverse ? 2 - mainAxis : mainAxis] ?? 'center',
|
|
772
|
+
},
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
type: 'node.setStyle',
|
|
776
|
+
payload: {
|
|
777
|
+
id: props.nodeId,
|
|
778
|
+
layer: layerFor(props.layer),
|
|
779
|
+
group: 'layout',
|
|
780
|
+
property: 'align',
|
|
781
|
+
value: values[column ? col : row] ?? 'center',
|
|
782
|
+
},
|
|
783
|
+
},
|
|
784
|
+
], { label: t('style.alignment') });
|
|
785
|
+
props.onError(result.ok ? '' : (result.error?.message ?? ''));
|
|
786
|
+
} })] }));
|
|
219
787
|
}
|