@next-buildr/editor 0.0.0-stage → 2.0.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/LICENSE +21 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/app/builder-editor.d.ts +8 -0
- package/dist/app/builder-editor.d.ts.map +1 -0
- package/dist/app/builder-editor.js +14 -0
- package/dist/app/builder-editor.test.d.ts +2 -0
- package/dist/app/builder-editor.test.d.ts.map +1 -0
- package/dist/app/builder-editor.test.js +199 -0
- package/dist/app/config.d.ts +59 -0
- package/dist/app/config.d.ts.map +1 -0
- package/dist/app/config.js +18 -0
- package/dist/app/content-language.test.d.ts +2 -0
- package/dist/app/content-language.test.d.ts.map +1 -0
- package/dist/app/content-language.test.js +157 -0
- package/dist/app/editor-app.d.ts +17 -0
- package/dist/app/editor-app.d.ts.map +1 -0
- package/dist/app/editor-app.js +206 -0
- package/dist/app/editor-app.test.d.ts +2 -0
- package/dist/app/editor-app.test.d.ts.map +1 -0
- package/dist/app/editor-app.test.js +135 -0
- package/dist/app/layout.d.ts +32 -0
- package/dist/app/layout.d.ts.map +1 -0
- package/dist/app/layout.js +82 -0
- package/dist/app/manifest.d.ts +12 -0
- package/dist/app/manifest.d.ts.map +1 -0
- package/dist/app/manifest.js +17 -0
- package/dist/app/shell-panels.d.ts +15 -0
- package/dist/app/shell-panels.d.ts.map +1 -0
- package/dist/app/shell-panels.js +5 -0
- package/dist/app/small-screen.d.ts +12 -0
- package/dist/app/small-screen.d.ts.map +1 -0
- package/dist/app/small-screen.js +33 -0
- package/dist/app/small-screen.test.d.ts +2 -0
- package/dist/app/small-screen.test.d.ts.map +1 -0
- package/dist/app/small-screen.test.js +108 -0
- package/dist/app/status-info.d.ts +14 -0
- package/dist/app/status-info.d.ts.map +1 -0
- package/dist/app/status-info.js +34 -0
- package/dist/app/use-resizable.d.ts +34 -0
- package/dist/app/use-resizable.d.ts.map +1 -0
- package/dist/app/use-resizable.js +84 -0
- package/dist/canvas-host/canvas-frame.d.ts +53 -0
- package/dist/canvas-host/canvas-frame.d.ts.map +1 -0
- package/dist/canvas-host/canvas-frame.js +146 -0
- package/dist/canvas-host/canvas-frame.test.d.ts +2 -0
- package/dist/canvas-host/canvas-frame.test.d.ts.map +1 -0
- package/dist/canvas-host/canvas-frame.test.js +91 -0
- package/dist/canvas-host/host.d.ts +109 -0
- package/dist/canvas-host/host.d.ts.map +1 -0
- package/dist/canvas-host/host.js +293 -0
- package/dist/canvas-host/host.test.d.ts +2 -0
- package/dist/canvas-host/host.test.d.ts.map +1 -0
- package/dist/canvas-host/host.test.js +398 -0
- package/dist/canvas-host/index.d.ts +5 -0
- package/dist/canvas-host/index.d.ts.map +1 -0
- package/dist/canvas-host/index.js +2 -0
- package/dist/clipboard/clipboard.d.ts +38 -0
- package/dist/clipboard/clipboard.d.ts.map +1 -0
- package/dist/clipboard/clipboard.js +160 -0
- package/dist/clipboard/clipboard.test.d.ts +2 -0
- package/dist/clipboard/clipboard.test.d.ts.map +1 -0
- package/dist/clipboard/clipboard.test.js +457 -0
- package/dist/clipboard/format.d.ts +27 -0
- package/dist/clipboard/format.d.ts.map +1 -0
- package/dist/clipboard/format.js +37 -0
- package/dist/clipboard/index.d.ts +6 -0
- package/dist/clipboard/index.d.ts.map +1 -0
- package/dist/clipboard/index.js +3 -0
- package/dist/clipboard/react.d.ts +20 -0
- package/dist/clipboard/react.d.ts.map +1 -0
- package/dist/clipboard/react.js +71 -0
- package/dist/dialogs/index.d.ts +2 -0
- package/dist/dialogs/index.d.ts.map +1 -0
- package/dist/dialogs/index.js +1 -0
- package/dist/dialogs/media-picker/index.d.ts +7 -0
- package/dist/dialogs/media-picker/index.d.ts.map +1 -0
- package/dist/dialogs/media-picker/index.js +3 -0
- package/dist/dialogs/media-picker/library.d.ts +17 -0
- package/dist/dialogs/media-picker/library.d.ts.map +1 -0
- package/dist/dialogs/media-picker/library.js +9 -0
- package/dist/dialogs/media-picker/media-picker.d.ts +18 -0
- package/dist/dialogs/media-picker/media-picker.d.ts.map +1 -0
- package/dist/dialogs/media-picker/media-picker.js +99 -0
- package/dist/dialogs/media-picker/media-picker.test.d.ts +2 -0
- package/dist/dialogs/media-picker/media-picker.test.d.ts.map +1 -0
- package/dist/dialogs/media-picker/media-picker.test.js +161 -0
- package/dist/dialogs/media-picker/media-ref.d.ts +28 -0
- package/dist/dialogs/media-picker/media-ref.d.ts.map +1 -0
- package/dist/dialogs/media-picker/media-ref.js +52 -0
- package/dist/dnd/check.d.ts +8 -0
- package/dist/dnd/check.d.ts.map +1 -0
- package/dist/dnd/check.js +12 -0
- package/dist/dnd/destinations.d.ts +15 -0
- package/dist/dnd/destinations.d.ts.map +1 -0
- package/dist/dnd/destinations.js +43 -0
- package/dist/dnd/dnd-react.test.d.ts +2 -0
- package/dist/dnd/dnd-react.test.d.ts.map +1 -0
- package/dist/dnd/dnd-react.test.js +93 -0
- package/dist/dnd/dnd.test.d.ts +2 -0
- package/dist/dnd/dnd.test.d.ts.map +1 -0
- package/dist/dnd/dnd.test.js +327 -0
- package/dist/dnd/engine.d.ts +85 -0
- package/dist/dnd/engine.d.ts.map +1 -0
- package/dist/dnd/engine.js +185 -0
- package/dist/dnd/fragment.d.ts +6 -0
- package/dist/dnd/fragment.d.ts.map +1 -0
- package/dist/dnd/fragment.js +18 -0
- package/dist/dnd/geometry.d.ts +30 -0
- package/dist/dnd/geometry.d.ts.map +1 -0
- package/dist/dnd/geometry.js +31 -0
- package/dist/dnd/index.d.ts +14 -0
- package/dist/dnd/index.d.ts.map +1 -0
- package/dist/dnd/index.js +7 -0
- package/dist/dnd/move-to-dialog.d.ts +13 -0
- package/dist/dnd/move-to-dialog.d.ts.map +1 -0
- package/dist/dnd/move-to-dialog.js +30 -0
- package/dist/dnd/react.d.ts +43 -0
- package/dist/dnd/react.d.ts.map +1 -0
- package/dist/dnd/react.js +185 -0
- package/dist/dnd/tree-target.d.ts +29 -0
- package/dist/dnd/tree-target.d.ts.map +1 -0
- package/dist/dnd/tree-target.js +97 -0
- package/dist/fonts/LICENSE-inter.txt +93 -0
- package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-600-normal.woff2 +0 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/messages/en.d.ts +335 -0
- package/dist/messages/en.d.ts.map +1 -0
- package/dist/messages/en.js +332 -0
- package/dist/messages/index.d.ts +16 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +22 -0
- package/dist/messages/pl.d.ts +3 -0
- package/dist/messages/pl.d.ts.map +1 -0
- package/dist/messages/pl.js +327 -0
- package/dist/panels/breadcrumbs/breadcrumbs.d.ts +6 -0
- package/dist/panels/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/panels/breadcrumbs/breadcrumbs.js +24 -0
- package/dist/panels/breadcrumbs/breadcrumbs.test.d.ts +2 -0
- package/dist/panels/breadcrumbs/breadcrumbs.test.d.ts.map +1 -0
- package/dist/panels/breadcrumbs/breadcrumbs.test.js +56 -0
- package/dist/panels/index.d.ts +9 -0
- package/dist/panels/index.d.ts.map +1 -0
- package/dist/panels/index.js +6 -0
- package/dist/panels/insert/catalog.d.ts +30 -0
- package/dist/panels/insert/catalog.d.ts.map +1 -0
- package/dist/panels/insert/catalog.js +76 -0
- package/dist/panels/insert/catalog.order.test.d.ts +2 -0
- package/dist/panels/insert/catalog.order.test.d.ts.map +1 -0
- package/dist/panels/insert/catalog.order.test.js +17 -0
- package/dist/panels/insert/category-name.d.ts +4 -0
- package/dist/panels/insert/category-name.d.ts.map +1 -0
- package/dist/panels/insert/category-name.js +8 -0
- package/dist/panels/insert/index.d.ts +3 -0
- package/dist/panels/insert/index.d.ts.map +1 -0
- package/dist/panels/insert/index.js +2 -0
- package/dist/panels/insert/insert-panel.d.ts +7 -0
- package/dist/panels/insert/insert-panel.d.ts.map +1 -0
- package/dist/panels/insert/insert-panel.js +155 -0
- package/dist/panels/insert/insert-panel.test.d.ts +2 -0
- package/dist/panels/insert/insert-panel.test.d.ts.map +1 -0
- package/dist/panels/insert/insert-panel.test.js +323 -0
- package/dist/panels/insert/target.d.ts +17 -0
- package/dist/panels/insert/target.d.ts.map +1 -0
- package/dist/panels/insert/target.js +48 -0
- package/dist/panels/inspector/controls/boolean.d.ts +4 -0
- package/dist/panels/inspector/controls/boolean.d.ts.map +1 -0
- package/dist/panels/inspector/controls/boolean.js +4 -0
- package/dist/panels/inspector/controls/compound.d.ts +15 -0
- package/dist/panels/inspector/controls/compound.d.ts.map +1 -0
- package/dist/panels/inspector/controls/compound.js +99 -0
- package/dist/panels/inspector/controls/compound.test.d.ts +2 -0
- package/dist/panels/inspector/controls/compound.test.d.ts.map +1 -0
- package/dist/panels/inspector/controls/compound.test.js +195 -0
- package/dist/panels/inspector/controls/icon.d.ts +5 -0
- package/dist/panels/inspector/controls/icon.d.ts.map +1 -0
- package/dist/panels/inspector/controls/icon.js +6 -0
- package/dist/panels/inspector/controls/index.d.ts +13 -0
- package/dist/panels/inspector/controls/index.d.ts.map +1 -0
- package/dist/panels/inspector/controls/index.js +11 -0
- package/dist/panels/inspector/controls/label.d.ts +4 -0
- package/dist/panels/inspector/controls/label.d.ts.map +1 -0
- package/dist/panels/inspector/controls/label.js +8 -0
- package/dist/panels/inspector/controls/link.d.ts +5 -0
- package/dist/panels/inspector/controls/link.d.ts.map +1 -0
- package/dist/panels/inspector/controls/link.js +6 -0
- package/dist/panels/inspector/controls/media.d.ts +9 -0
- package/dist/panels/inspector/controls/media.d.ts.map +1 -0
- package/dist/panels/inspector/controls/media.js +21 -0
- package/dist/panels/inspector/controls/number.d.ts +10 -0
- package/dist/panels/inspector/controls/number.d.ts.map +1 -0
- package/dist/panels/inspector/controls/number.js +33 -0
- package/dist/panels/inspector/controls/rich-text-model.d.ts +20 -0
- package/dist/panels/inspector/controls/rich-text-model.d.ts.map +1 -0
- package/dist/panels/inspector/controls/rich-text-model.js +91 -0
- package/dist/panels/inspector/controls/rich-text.d.ts +10 -0
- package/dist/panels/inspector/controls/rich-text.d.ts.map +1 -0
- package/dist/panels/inspector/controls/rich-text.js +159 -0
- package/dist/panels/inspector/controls/select.d.ts +5 -0
- package/dist/panels/inspector/controls/select.d.ts.map +1 -0
- package/dist/panels/inspector/controls/select.js +16 -0
- package/dist/panels/inspector/controls/select.test.d.ts +2 -0
- package/dist/panels/inspector/controls/select.test.d.ts.map +1 -0
- package/dist/panels/inspector/controls/select.test.js +43 -0
- package/dist/panels/inspector/controls/text.d.ts +4 -0
- package/dist/panels/inspector/controls/text.d.ts.map +1 -0
- package/dist/panels/inspector/controls/text.js +5 -0
- package/dist/panels/inspector/controls/textarea.d.ts +4 -0
- package/dist/panels/inspector/controls/textarea.d.ts.map +1 -0
- package/dist/panels/inspector/controls/textarea.js +4 -0
- package/dist/panels/inspector/controls/types.d.ts +16 -0
- package/dist/panels/inspector/controls/types.d.ts.map +1 -0
- package/dist/panels/inspector/controls/types.js +1 -0
- package/dist/panels/inspector/index.d.ts +17 -0
- package/dist/panels/inspector/index.d.ts.map +1 -0
- package/dist/panels/inspector/index.js +9 -0
- package/dist/panels/inspector/inspector.d.ts +16 -0
- package/dist/panels/inspector/inspector.d.ts.map +1 -0
- package/dist/panels/inspector/inspector.js +116 -0
- package/dist/panels/inspector/inspector.test.d.ts +2 -0
- package/dist/panels/inspector/inspector.test.d.ts.map +1 -0
- package/dist/panels/inspector/inspector.test.js +328 -0
- package/dist/panels/inspector/props-panel.d.ts +26 -0
- package/dist/panels/inspector/props-panel.d.ts.map +1 -0
- package/dist/panels/inspector/props-panel.js +117 -0
- package/dist/panels/inspector/styles/box-model.d.ts +20 -0
- package/dist/panels/inspector/styles/box-model.d.ts.map +1 -0
- package/dist/panels/inspector/styles/box-model.js +31 -0
- package/dist/panels/inspector/styles/index.d.ts +5 -0
- package/dist/panels/inspector/styles/index.d.ts.map +1 -0
- package/dist/panels/inspector/styles/index.js +2 -0
- package/dist/panels/inspector/styles/model.d.ts +55 -0
- package/dist/panels/inspector/styles/model.d.ts.map +1 -0
- package/dist/panels/inspector/styles/model.js +111 -0
- package/dist/panels/inspector/styles/segments.d.ts +18 -0
- package/dist/panels/inspector/styles/segments.d.ts.map +1 -0
- package/dist/panels/inspector/styles/segments.js +75 -0
- package/dist/panels/inspector/styles/sides-editor.d.ts +34 -0
- package/dist/panels/inspector/styles/sides-editor.d.ts.map +1 -0
- package/dist/panels/inspector/styles/sides-editor.js +86 -0
- package/dist/panels/inspector/styles/style-inspector.d.ts +15 -0
- package/dist/panels/inspector/styles/style-inspector.d.ts.map +1 -0
- package/dist/panels/inspector/styles/style-inspector.js +219 -0
- package/dist/panels/inspector/styles/style-inspector.test.d.ts +2 -0
- package/dist/panels/inspector/styles/style-inspector.test.d.ts.map +1 -0
- package/dist/panels/inspector/styles/style-inspector.test.js +265 -0
- package/dist/panels/inspector/styles/token-picker.d.ts +15 -0
- package/dist/panels/inspector/styles/token-picker.d.ts.map +1 -0
- package/dist/panels/inspector/styles/token-picker.js +23 -0
- package/dist/panels/inspector/styles/use-style-value.d.ts +28 -0
- package/dist/panels/inspector/styles/use-style-value.d.ts.map +1 -0
- package/dist/panels/inspector/styles/use-style-value.js +51 -0
- package/dist/panels/inspector/value.d.ts +20 -0
- package/dist/panels/inspector/value.d.ts.map +1 -0
- package/dist/panels/inspector/value.js +32 -0
- package/dist/panels/inspector/values/analyze.d.ts +49 -0
- package/dist/panels/inspector/values/analyze.d.ts.map +1 -0
- package/dist/panels/inspector/values/analyze.js +115 -0
- package/dist/panels/inspector/values/data.d.ts +18 -0
- package/dist/panels/inspector/values/data.d.ts.map +1 -0
- package/dist/panels/inspector/values/data.js +10 -0
- package/dist/panels/inspector/values/translation.d.ts +20 -0
- package/dist/panels/inspector/values/translation.d.ts.map +1 -0
- package/dist/panels/inspector/values/translation.js +25 -0
- package/dist/panels/inspector/values/value-editor.d.ts +30 -0
- package/dist/panels/inspector/values/value-editor.d.ts.map +1 -0
- package/dist/panels/inspector/values/value-editor.js +191 -0
- package/dist/panels/inspector/values/values.test.d.ts +2 -0
- package/dist/panels/inspector/values/values.test.d.ts.map +1 -0
- package/dist/panels/inspector/values/values.test.js +173 -0
- package/dist/panels/issues/collect.d.ts +70 -0
- package/dist/panels/issues/collect.d.ts.map +1 -0
- package/dist/panels/issues/collect.js +96 -0
- package/dist/panels/issues/index.d.ts +5 -0
- package/dist/panels/issues/index.d.ts.map +1 -0
- package/dist/panels/issues/index.js +2 -0
- package/dist/panels/issues/issues-panel.d.ts +17 -0
- package/dist/panels/issues/issues-panel.d.ts.map +1 -0
- package/dist/panels/issues/issues-panel.js +77 -0
- package/dist/panels/layers/flatten.d.ts +28 -0
- package/dist/panels/layers/flatten.d.ts.map +1 -0
- package/dist/panels/layers/flatten.js +61 -0
- package/dist/panels/layers/layers-panel.d.ts +14 -0
- package/dist/panels/layers/layers-panel.d.ts.map +1 -0
- package/dist/panels/layers/layers-panel.js +428 -0
- package/dist/panels/layers/layers-panel.test.d.ts +2 -0
- package/dist/panels/layers/layers-panel.test.d.ts.map +1 -0
- package/dist/panels/layers/layers-panel.test.js +315 -0
- package/dist/persistence/controller.d.ts +55 -0
- package/dist/persistence/controller.d.ts.map +1 -0
- package/dist/persistence/controller.js +341 -0
- package/dist/persistence/index.d.ts +6 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +3 -0
- package/dist/persistence/load.d.ts +35 -0
- package/dist/persistence/load.d.ts.map +1 -0
- package/dist/persistence/load.js +67 -0
- package/dist/persistence/persistence.test.d.ts +2 -0
- package/dist/persistence/persistence.test.d.ts.map +1 -0
- package/dist/persistence/persistence.test.js +483 -0
- package/dist/persistence/react.d.ts +18 -0
- package/dist/persistence/react.d.ts.map +1 -0
- package/dist/persistence/react.js +105 -0
- package/dist/persistence/types.d.ts +182 -0
- package/dist/persistence/types.d.ts.map +1 -0
- package/dist/persistence/types.js +1 -0
- package/dist/preview/index.d.ts +3 -0
- package/dist/preview/index.d.ts.map +1 -0
- package/dist/preview/index.js +2 -0
- package/dist/preview/prepare.d.ts +16 -0
- package/dist/preview/prepare.d.ts.map +1 -0
- package/dist/preview/prepare.js +21 -0
- package/dist/preview/preview.d.ts +27 -0
- package/dist/preview/preview.d.ts.map +1 -0
- package/dist/preview/preview.js +51 -0
- package/dist/preview/preview.test.d.ts +2 -0
- package/dist/preview/preview.test.d.ts.map +1 -0
- package/dist/preview/preview.test.js +129 -0
- package/dist/shortcuts/actions.d.ts +17 -0
- package/dist/shortcuts/actions.d.ts.map +1 -0
- package/dist/shortcuts/actions.js +85 -0
- package/dist/shortcuts/index.d.ts +11 -0
- package/dist/shortcuts/index.d.ts.map +1 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/keys.d.ts +29 -0
- package/dist/shortcuts/keys.d.ts.map +1 -0
- package/dist/shortcuts/keys.js +100 -0
- package/dist/shortcuts/map.d.ts +17 -0
- package/dist/shortcuts/map.d.ts.map +1 -0
- package/dist/shortcuts/map.js +31 -0
- package/dist/shortcuts/registry.d.ts +32 -0
- package/dist/shortcuts/registry.d.ts.map +1 -0
- package/dist/shortcuts/registry.js +53 -0
- package/dist/shortcuts/shortcuts.d.ts +32 -0
- package/dist/shortcuts/shortcuts.d.ts.map +1 -0
- package/dist/shortcuts/shortcuts.js +95 -0
- package/dist/shortcuts/shortcuts.test.d.ts +2 -0
- package/dist/shortcuts/shortcuts.test.d.ts.map +1 -0
- package/dist/shortcuts/shortcuts.test.js +263 -0
- package/dist/store/create-store.d.ts +13 -0
- package/dist/store/create-store.d.ts.map +1 -0
- package/dist/store/create-store.js +248 -0
- package/dist/store/index.d.ts +9 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -0
- package/dist/store/locale.d.ts +23 -0
- package/dist/store/locale.d.ts.map +1 -0
- package/dist/store/locale.js +31 -0
- package/dist/store/react.d.ts +17 -0
- package/dist/store/react.d.ts.map +1 -0
- package/dist/store/react.js +32 -0
- package/dist/store/selection.d.ts +32 -0
- package/dist/store/selection.d.ts.map +1 -0
- package/dist/store/selection.js +84 -0
- package/dist/store/selection.test.d.ts +2 -0
- package/dist/store/selection.test.d.ts.map +1 -0
- package/dist/store/selection.test.js +95 -0
- package/dist/store/selectors.d.ts +18 -0
- package/dist/store/selectors.d.ts.map +1 -0
- package/dist/store/selectors.js +39 -0
- package/dist/store/store.test.d.ts +2 -0
- package/dist/store/store.test.d.ts.map +1 -0
- package/dist/store/store.test.js +331 -0
- package/dist/store/types.d.ts +114 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +1 -0
- package/dist/styles/tokens.test.d.ts +2 -0
- package/dist/styles/tokens.test.d.ts.map +1 -0
- package/dist/styles/tokens.test.js +199 -0
- package/dist/styles.css +2885 -0
- package/dist/toolbar/brand.d.ts +7 -0
- package/dist/toolbar/brand.d.ts.map +1 -0
- package/dist/toolbar/brand.js +11 -0
- package/dist/toolbar/breakpoint-control.d.ts +9 -0
- package/dist/toolbar/breakpoint-control.d.ts.map +1 -0
- package/dist/toolbar/breakpoint-control.js +23 -0
- package/dist/toolbar/editable-title.d.ts +14 -0
- package/dist/toolbar/editable-title.d.ts.map +1 -0
- package/dist/toolbar/editable-title.js +46 -0
- package/dist/toolbar/editable-title.test.d.ts +2 -0
- package/dist/toolbar/editable-title.test.d.ts.map +1 -0
- package/dist/toolbar/editable-title.test.js +53 -0
- package/dist/toolbar/index.d.ts +12 -0
- package/dist/toolbar/index.d.ts.map +1 -0
- package/dist/toolbar/index.js +5 -0
- package/dist/toolbar/locale-switcher.d.ts +10 -0
- package/dist/toolbar/locale-switcher.d.ts.map +1 -0
- package/dist/toolbar/locale-switcher.js +20 -0
- package/dist/toolbar/more-menu.d.ts +12 -0
- package/dist/toolbar/more-menu.d.ts.map +1 -0
- package/dist/toolbar/more-menu.js +47 -0
- package/dist/toolbar/panel-toggles.d.ts +9 -0
- package/dist/toolbar/panel-toggles.d.ts.map +1 -0
- package/dist/toolbar/panel-toggles.js +19 -0
- package/dist/toolbar/publish-dialog.d.ts +18 -0
- package/dist/toolbar/publish-dialog.d.ts.map +1 -0
- package/dist/toolbar/publish-dialog.js +49 -0
- package/dist/toolbar/publish.test.d.ts +2 -0
- package/dist/toolbar/publish.test.d.ts.map +1 -0
- package/dist/toolbar/publish.test.js +258 -0
- package/dist/toolbar/sample-picker.d.ts +18 -0
- package/dist/toolbar/sample-picker.d.ts.map +1 -0
- package/dist/toolbar/sample-picker.js +72 -0
- package/dist/toolbar/sample-picker.test.d.ts +2 -0
- package/dist/toolbar/sample-picker.test.d.ts.map +1 -0
- package/dist/toolbar/sample-picker.test.js +78 -0
- package/dist/toolbar/save-indicator.d.ts +8 -0
- package/dist/toolbar/save-indicator.d.ts.map +1 -0
- package/dist/toolbar/save-indicator.js +30 -0
- package/dist/toolbar/theme.d.ts +22 -0
- package/dist/toolbar/theme.d.ts.map +1 -0
- package/dist/toolbar/theme.js +46 -0
- package/dist/toolbar/theme.test.d.ts +2 -0
- package/dist/toolbar/theme.test.d.ts.map +1 -0
- package/dist/toolbar/theme.test.js +49 -0
- package/dist/toolbar/toolbar-centre.d.ts +13 -0
- package/dist/toolbar/toolbar-centre.d.ts.map +1 -0
- package/dist/toolbar/toolbar-centre.js +7 -0
- package/dist/toolbar/toolbar-left.d.ts +12 -0
- package/dist/toolbar/toolbar-left.d.ts.map +1 -0
- package/dist/toolbar/toolbar-left.js +16 -0
- package/dist/toolbar/toolbar-right.d.ts +19 -0
- package/dist/toolbar/toolbar-right.d.ts.map +1 -0
- package/dist/toolbar/toolbar-right.js +21 -0
- package/dist/toolbar/toolbar.d.ts +38 -0
- package/dist/toolbar/toolbar.d.ts.map +1 -0
- package/dist/toolbar/toolbar.js +27 -0
- package/dist/toolbar/toolbar.test.d.ts +2 -0
- package/dist/toolbar/toolbar.test.d.ts.map +1 -0
- package/dist/toolbar/toolbar.test.js +289 -0
- package/dist/toolbar/use-overflow-level.d.ts +9 -0
- package/dist/toolbar/use-overflow-level.d.ts.map +1 -0
- package/dist/toolbar/use-overflow-level.js +40 -0
- package/dist/toolbar/zoom-menu.d.ts +10 -0
- package/dist/toolbar/zoom-menu.d.ts.map +1 -0
- package/dist/toolbar/zoom-menu.js +17 -0
- package/dist/ui/icon.d.ts +102 -0
- package/dist/ui/icon.d.ts.map +1 -0
- package/dist/ui/icon.js +182 -0
- package/dist/ui/icon.test.d.ts +2 -0
- package/dist/ui/icon.test.d.ts.map +1 -0
- package/dist/ui/icon.test.js +115 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +5 -0
- package/dist/ui/panel.d.ts +18 -0
- package/dist/ui/panel.d.ts.map +1 -0
- package/dist/ui/panel.js +21 -0
- package/dist/ui/portal.d.ts +14 -0
- package/dist/ui/portal.d.ts.map +1 -0
- package/dist/ui/portal.js +14 -0
- package/dist/ui/primitives.d.ts +190 -0
- package/dist/ui/primitives.d.ts.map +1 -0
- package/dist/ui/primitives.js +164 -0
- package/dist/ui/primitives.test.d.ts +2 -0
- package/dist/ui/primitives.test.d.ts.map +1 -0
- package/dist/ui/primitives.test.js +215 -0
- package/dist/ui/toast.d.ts +39 -0
- package/dist/ui/toast.d.ts.map +1 -0
- package/dist/ui/toast.js +76 -0
- package/dist/ui/toast.test.d.ts +2 -0
- package/dist/ui/toast.test.d.ts.map +1 -0
- package/dist/ui/toast.test.js +95 -0
- package/package.json +66 -3
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-left.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-left.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IACnE,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACpD,uGAAuG;IACvG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAOD,0GAA0G;AAC1G,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,gBAAgB,+BAkChF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '../messages/index.js';
|
|
3
|
+
import { useEditorState } from '../store/index.js';
|
|
4
|
+
import { Icon, Tooltip } from '../ui/index.js';
|
|
5
|
+
import { Brand } from './brand.js';
|
|
6
|
+
import { EditableTitle } from './editable-title.js';
|
|
7
|
+
const STATUS_LABELS = {
|
|
8
|
+
draft: 'toolbar.status.draft',
|
|
9
|
+
published: 'toolbar.status.published',
|
|
10
|
+
};
|
|
11
|
+
/** The product mark, back to the CMS as an icon button, the page name and its draft or published pill. */
|
|
12
|
+
export function ToolbarLeft({ title, onRename, status, cmsUrl }) {
|
|
13
|
+
const t = useT();
|
|
14
|
+
const readOnly = useEditorState((state) => state.readOnly);
|
|
15
|
+
return (_jsxs("div", { className: "bd-toolbar-zone", "data-zone": "left", children: [_jsx(Brand, {}), cmsUrl !== undefined && (_jsx(Tooltip, { content: t('toolbar.back'), children: _jsx("a", { className: "bd-button bd-icon-button bd-toolbar-link", "data-variant": "ghost", href: cmsUrl, "aria-label": t('toolbar.back'), children: _jsx(Icon, { name: "arrow-left" }) }) })), onRename === undefined ? (_jsx("h1", { className: "bd-toolbar-title", title: title, children: title })) : (_jsx("h1", { className: "bd-toolbar-heading", children: _jsx(EditableTitle, { title: title, onRename: onRename, disabled: readOnly }) })), status !== undefined && (_jsx("span", { className: "bd-status-pill", "data-status": status, children: t(STATUS_LABELS[status]) }))] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ToolbarRightProps {
|
|
3
|
+
/** The locale and sample pickers (the shell's), placed between the save status and Preview. */
|
|
4
|
+
readonly pickers?: ReactNode;
|
|
5
|
+
readonly status: string;
|
|
6
|
+
readonly onPreview?: (() => void) | undefined;
|
|
7
|
+
readonly onPublish?: (() => void) | undefined;
|
|
8
|
+
readonly canPublish?: boolean | undefined;
|
|
9
|
+
/** The save text is visually hidden (the row is tight). */
|
|
10
|
+
readonly compactSave: boolean;
|
|
11
|
+
/** The version history: a link in the row, or an item of the more menu when the row is tight. */
|
|
12
|
+
readonly historyUrl?: string | undefined;
|
|
13
|
+
readonly historyInMenu: boolean;
|
|
14
|
+
/** The CMS link, when the row had no room for it; the more menu lists it. */
|
|
15
|
+
readonly moreCmsUrl?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Undo and redo, the save status, the pickers, Preview (secondary), Publish (the one primary) and more. */
|
|
18
|
+
export declare function ToolbarRight(props: ToolbarRightProps): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=toolbar-right.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-right.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-right.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,iBAAiB;IAChC,+FAA+F;IAC/F,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,iGAAiG;IACjG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED,4GAA4G;AAC5G,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAgEpD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useT } from '../messages/index.js';
|
|
3
|
+
import { useShortcutHint } from '../shortcuts/index.js';
|
|
4
|
+
import { useEditor, useEditorState } from '../store/index.js';
|
|
5
|
+
import { Button, Icon, IconButton, Tooltip } from '../ui/index.js';
|
|
6
|
+
import { MoreMenu } from './more-menu.js';
|
|
7
|
+
import { SaveIndicator } from './save-indicator.js';
|
|
8
|
+
/** Undo and redo, the save status, the pickers, Preview (secondary), Publish (the one primary) and more. */
|
|
9
|
+
export function ToolbarRight(props) {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const store = useEditor();
|
|
12
|
+
const canUndo = useEditorState((state) => state.canUndo);
|
|
13
|
+
const canRedo = useEditorState((state) => state.canRedo);
|
|
14
|
+
const readOnly = useEditorState((state) => state.readOnly);
|
|
15
|
+
const undoHint = useShortcutHint('edit.undo');
|
|
16
|
+
const redoHint = useShortcutHint('edit.redo');
|
|
17
|
+
return (_jsxs("div", { className: "bd-toolbar-zone", "data-zone": "right", children: [_jsxs("fieldset", { className: "bd-toolbar-group", "aria-label": t('toolbar.history'), children: [_jsx(IconButton, { label: t('shortcut.undo'), hint: undoHint, icon: "undo-2", variant: "ghost", disabled: !canUndo || readOnly, onClick: () => store.undo() }), _jsx(IconButton, { label: t('shortcut.redo'), hint: redoHint, icon: "redo-2", variant: "ghost", disabled: !canRedo || readOnly, onClick: () => store.redo() })] }), _jsx(SaveIndicator, { compact: props.compactSave }), props.pickers, props.historyUrl !== undefined && !props.historyInMenu && (_jsx(Tooltip, { content: t('toolbar.versions'), children: _jsx("a", { className: "bd-button bd-icon-button bd-toolbar-link", "data-variant": "ghost", href: props.historyUrl, "aria-label": t('toolbar.versions'), children: _jsx(Icon, { name: "history" }) }) })), _jsx(Button, { onClick: props.onPreview, disabled: props.onPreview === undefined, children: t('toolbar.preview') }), _jsx(Button, { variant: "primary", onClick: props.onPublish, disabled: props.onPublish === undefined ||
|
|
18
|
+
props.canPublish === false ||
|
|
19
|
+
readOnly ||
|
|
20
|
+
props.status === 'conflict', children: t('toolbar.publish') }), _jsx(MoreMenu, { historyUrl: props.historyInMenu ? props.historyUrl : undefined, cmsUrl: props.moreCmsUrl })] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { BreakpointConfig } from '../app/config.ts';
|
|
3
|
+
import type { Zoom } from './zoom-menu.tsx';
|
|
4
|
+
export interface ToolbarProps {
|
|
5
|
+
/** The document's title, shown after the link back. */
|
|
6
|
+
readonly title: string;
|
|
7
|
+
/** Saves a new page name (`adapter.rename`); the title is not editable without it. */
|
|
8
|
+
readonly onTitleChange?: ((title: string) => Promise<void>) | undefined;
|
|
9
|
+
/** Draft or published, as a pill next to the title. */
|
|
10
|
+
readonly status?: 'draft' | 'published' | undefined;
|
|
11
|
+
readonly breakpoints: readonly BreakpointConfig[];
|
|
12
|
+
readonly breakpoint: string;
|
|
13
|
+
readonly onBreakpointChange: (id: string) => void;
|
|
14
|
+
/** The canvas zoom (`host.setZoom`); `fit` when left out. */
|
|
15
|
+
readonly zoom?: Zoom | undefined;
|
|
16
|
+
/** Changes the canvas zoom; the zoom menu is left out without it. */
|
|
17
|
+
readonly onZoomChange?: ((zoom: Zoom) => void) | undefined;
|
|
18
|
+
/** The page in the CMS's admin (`adapter.cmsUrl`); the link is left out without it. */
|
|
19
|
+
readonly cmsUrl?: string | undefined;
|
|
20
|
+
/** The version history in the CMS; the link is left out without it. */
|
|
21
|
+
readonly historyUrl?: string | undefined;
|
|
22
|
+
/** The locale and sample pickers, rendered on the right between the save status and Preview. */
|
|
23
|
+
readonly pickers?: ReactNode;
|
|
24
|
+
/** Flushes the save and opens the preview (PB-091). */
|
|
25
|
+
readonly onPreview?: (() => void) | undefined;
|
|
26
|
+
/** Opens the publish dialog (PB-088). */
|
|
27
|
+
readonly onPublish?: (() => void) | undefined;
|
|
28
|
+
/** The session may publish (`adapter.getSession().canPublish`). */
|
|
29
|
+
readonly canPublish?: boolean | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The editor's primary actions (docs/editor.md#toolbar-pb-083) in three zones: the link back, title
|
|
33
|
+
* and status on the left; screen size and zoom in the centre; undo/redo, save status, pickers,
|
|
34
|
+
* Preview, Publish and the more menu on the right. It reads the store and the persistence
|
|
35
|
+
* controller from context; the shortcuts show in the tooltips.
|
|
36
|
+
*/
|
|
37
|
+
export declare function Toolbar(props: ToolbarProps): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAOzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IACxE,uDAAuD;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACjC,qEAAqE;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,uFAAuF;IACvF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,uEAAuE;IACvE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,gGAAgG;IAChG,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,mEAAmE;IACnE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC3C;AASD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAsC1C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { usePersistenceState } from '../persistence/index.js';
|
|
4
|
+
import { PanelToggle } from './panel-toggles.js';
|
|
5
|
+
import { ToolbarCentre } from './toolbar-centre.js';
|
|
6
|
+
import { ToolbarLeft } from './toolbar-left.js';
|
|
7
|
+
import { ToolbarRight } from './toolbar-right.js';
|
|
8
|
+
import { useOverflowLevel } from './use-overflow-level.js';
|
|
9
|
+
/**
|
|
10
|
+
* What changes as the row runs out of room, in order (a step is taken only when the content
|
|
11
|
+
* overflows): 1 the version history moves into the more menu, 2 the save text becomes icon only,
|
|
12
|
+
* 3 the link back to the CMS moves into the more menu, 4 the title may shrink.
|
|
13
|
+
*/
|
|
14
|
+
const COLLAPSE = { versions: 1, saveText: 2, cms: 3, title: 4 };
|
|
15
|
+
/**
|
|
16
|
+
* The editor's primary actions (docs/editor.md#toolbar-pb-083) in three zones: the link back, title
|
|
17
|
+
* and status on the left; screen size and zoom in the centre; undo/redo, save status, pickers,
|
|
18
|
+
* Preview, Publish and the more menu on the right. It reads the store and the persistence
|
|
19
|
+
* controller from context; the shortcuts show in the tooltips.
|
|
20
|
+
*/
|
|
21
|
+
export function Toolbar(props) {
|
|
22
|
+
const row = useRef(null);
|
|
23
|
+
const level = useOverflowLevel(row, COLLAPSE.title);
|
|
24
|
+
const status = usePersistenceState((state) => state.status);
|
|
25
|
+
const cmsMoved = level >= COLLAPSE.cms;
|
|
26
|
+
return (_jsxs("div", { className: "bd-toolbar-row", ref: row, "data-level": level, children: [_jsx(PanelToggle, { side: "left" }), _jsx(ToolbarLeft, { title: props.title, onRename: props.onTitleChange, status: props.status, cmsUrl: cmsMoved ? undefined : props.cmsUrl }), _jsx("span", { className: "bd-toolbar-spacer" }), _jsx(ToolbarCentre, { breakpoints: props.breakpoints, breakpoint: props.breakpoint, onBreakpointChange: props.onBreakpointChange, zoom: props.zoom, onZoomChange: props.onZoomChange }), _jsx("span", { className: "bd-toolbar-spacer" }), _jsx(ToolbarRight, { pickers: props.pickers, status: status, onPreview: props.onPreview, onPublish: props.onPublish, canPublish: props.canPublish, compactSave: level >= COLLAPSE.saveText, historyUrl: props.historyUrl, historyInMenu: level >= COLLAPSE.versions, moreCmsUrl: cmsMoved ? props.cmsUrl : undefined }), _jsx(PanelToggle, { side: "right" })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.test.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// @vitest-environment jsdom
|
|
3
|
+
import { createRegistryMeta, createSeededIdGenerator, } from '@next-buildr/core';
|
|
4
|
+
import { act } from 'react';
|
|
5
|
+
import { createRoot } from 'react-dom/client';
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
7
|
+
import { axe } from 'vitest-axe';
|
|
8
|
+
import * as matchers from 'vitest-axe/matchers';
|
|
9
|
+
import { MessagesProvider } from '../messages/index.js';
|
|
10
|
+
import { createPersistence, PersistenceProvider, } from '../persistence/index.js';
|
|
11
|
+
import { ShortcutProvider } from '../shortcuts/index.js';
|
|
12
|
+
import { createEditorStore, EditorStoreProvider } from '../store/index.js';
|
|
13
|
+
import { ToastProvider } from '../ui/index.js';
|
|
14
|
+
import { ThemeProvider } from './theme.js';
|
|
15
|
+
import { Toolbar } from './toolbar.js';
|
|
16
|
+
expect.extend(matchers);
|
|
17
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
18
|
+
const item = {
|
|
19
|
+
type: 'buildr/item',
|
|
20
|
+
version: 1,
|
|
21
|
+
label: 'Item',
|
|
22
|
+
category: 'content',
|
|
23
|
+
props: {},
|
|
24
|
+
contentCategories: ['flow'],
|
|
25
|
+
styles: { groups: [] },
|
|
26
|
+
runtime: 'shared',
|
|
27
|
+
slots: { default: {} },
|
|
28
|
+
};
|
|
29
|
+
const page = {
|
|
30
|
+
...item,
|
|
31
|
+
type: 'buildr/page',
|
|
32
|
+
label: 'Page',
|
|
33
|
+
capabilities: { root: true },
|
|
34
|
+
};
|
|
35
|
+
const registryMeta = createRegistryMeta({ components: [page, item] });
|
|
36
|
+
const fixture = () => ({
|
|
37
|
+
schemaVersion: 1,
|
|
38
|
+
root: 'root',
|
|
39
|
+
nodes: {
|
|
40
|
+
root: { id: 'root', type: 'buildr/page', slots: { default: ['itemAAAAA1'] } },
|
|
41
|
+
itemAAAAA1: { id: 'itemAAAAA1', type: 'buildr/item' },
|
|
42
|
+
},
|
|
43
|
+
components: {},
|
|
44
|
+
});
|
|
45
|
+
const adapter = {
|
|
46
|
+
save: async () => ({ ok: true, revision: 2, updatedAt: 't2' }),
|
|
47
|
+
};
|
|
48
|
+
const breakpoints = [
|
|
49
|
+
{ id: 'desktop', width: 1280 },
|
|
50
|
+
{ id: 'tablet', width: 820 },
|
|
51
|
+
{ id: 'mobile', width: 390 },
|
|
52
|
+
];
|
|
53
|
+
describe('Toolbar', () => {
|
|
54
|
+
let container;
|
|
55
|
+
let root;
|
|
56
|
+
let controller;
|
|
57
|
+
const buttons = () => [...container.querySelectorAll('button')];
|
|
58
|
+
const byName = (name) => buttons().find((b) => (b.getAttribute('aria-label') ?? b.textContent ?? '').includes(name));
|
|
59
|
+
async function mount(overrides = {}, options = {}) {
|
|
60
|
+
const store = createEditorStore({
|
|
61
|
+
doc: fixture(),
|
|
62
|
+
registry: registryMeta,
|
|
63
|
+
generateId: createSeededIdGenerator(3),
|
|
64
|
+
validationDelayMs: null,
|
|
65
|
+
});
|
|
66
|
+
if (options.readOnly === true)
|
|
67
|
+
store.setReadOnly(true);
|
|
68
|
+
controller = createPersistence({
|
|
69
|
+
store,
|
|
70
|
+
adapter,
|
|
71
|
+
ref: { collection: 'pages', id: '1' },
|
|
72
|
+
revision: 1,
|
|
73
|
+
});
|
|
74
|
+
const props = {
|
|
75
|
+
title: 'Home',
|
|
76
|
+
breakpoints,
|
|
77
|
+
breakpoint: 'desktop',
|
|
78
|
+
onBreakpointChange: () => undefined,
|
|
79
|
+
...overrides,
|
|
80
|
+
};
|
|
81
|
+
await act(async () => root.render(_jsx(MessagesProvider, { locale: "en", children: _jsx(EditorStoreProvider, { store: store, children: _jsx(ShortcutProvider, { platform: "other", children: _jsx(ToastProvider, { children: _jsx(PersistenceProvider, { controller: controller, children: _jsx(ThemeProvider, { value: options.theme, children: _jsx("div", { role: "toolbar", "aria-label": "Toolbar", children: _jsx(Toolbar, { ...props }) }) }) }) }) }) }) })));
|
|
82
|
+
return store;
|
|
83
|
+
}
|
|
84
|
+
beforeEach(() => {
|
|
85
|
+
container = document.createElement('div');
|
|
86
|
+
document.body.append(container);
|
|
87
|
+
root = createRoot(container);
|
|
88
|
+
});
|
|
89
|
+
afterEach(() => {
|
|
90
|
+
act(() => root.unmount());
|
|
91
|
+
document.body.innerHTML = '';
|
|
92
|
+
});
|
|
93
|
+
it('shows the title and switches the breakpoint', async () => {
|
|
94
|
+
const onBreakpointChange = vi.fn();
|
|
95
|
+
await mount({ onBreakpointChange, breakpoint: 'tablet' });
|
|
96
|
+
expect(container.querySelector('h1')?.textContent).toBe('Home');
|
|
97
|
+
expect(byName('Tablet')?.getAttribute('aria-pressed')).toBe('true');
|
|
98
|
+
expect(byName('Desktop')?.getAttribute('aria-pressed')).toBe('false');
|
|
99
|
+
await act(async () => byName('Mobile')?.click());
|
|
100
|
+
expect(onBreakpointChange).toHaveBeenCalledWith('mobile');
|
|
101
|
+
});
|
|
102
|
+
it('enables undo and redo only when there is something to undo or redo', async () => {
|
|
103
|
+
const store = await mount();
|
|
104
|
+
const undo = () => byName('Undo');
|
|
105
|
+
const redo = () => byName('Redo');
|
|
106
|
+
expect(undo().disabled).toBe(true);
|
|
107
|
+
expect(redo().disabled).toBe(true);
|
|
108
|
+
await act(async () => {
|
|
109
|
+
store.dispatch({
|
|
110
|
+
type: 'node.setAttr',
|
|
111
|
+
payload: { id: 'itemAAAAA1', key: 'name', value: 'a' },
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
expect(undo().disabled).toBe(false);
|
|
115
|
+
await act(async () => undo().click());
|
|
116
|
+
expect(undo().disabled).toBe(true);
|
|
117
|
+
expect(redo().disabled).toBe(false);
|
|
118
|
+
await act(async () => redo().click());
|
|
119
|
+
expect(store.getState().doc.nodes['itemAAAAA1']?.name).toBe('a');
|
|
120
|
+
});
|
|
121
|
+
it('disables undo and redo of a read-only document', async () => {
|
|
122
|
+
await mount({}, { readOnly: true });
|
|
123
|
+
expect(byName('Undo').disabled).toBe(true);
|
|
124
|
+
expect(container.textContent).toContain('Read only');
|
|
125
|
+
});
|
|
126
|
+
it('shows the save status', async () => {
|
|
127
|
+
const store = await mount();
|
|
128
|
+
expect(container.querySelector('[role=status]')?.textContent).toContain('All changes saved');
|
|
129
|
+
await act(async () => {
|
|
130
|
+
store.dispatch({
|
|
131
|
+
type: 'node.setAttr',
|
|
132
|
+
payload: { id: 'itemAAAAA1', key: 'name', value: 'a' },
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
expect(container.querySelector('[role=status]')?.textContent).toContain('Unsaved changes');
|
|
136
|
+
});
|
|
137
|
+
it('calls preview and publish, which are off without a handler or the right', async () => {
|
|
138
|
+
const onPreview = vi.fn();
|
|
139
|
+
const onPublish = vi.fn();
|
|
140
|
+
await mount({ onPreview, onPublish });
|
|
141
|
+
await act(async () => byName('Preview')?.click());
|
|
142
|
+
await act(async () => byName('Publish')?.click());
|
|
143
|
+
expect(onPreview).toHaveBeenCalledOnce();
|
|
144
|
+
expect(onPublish).toHaveBeenCalledOnce();
|
|
145
|
+
await mount({ onPublish, canPublish: false });
|
|
146
|
+
expect(byName('Publish').disabled).toBe(true);
|
|
147
|
+
expect(byName('Preview').disabled).toBe(true);
|
|
148
|
+
});
|
|
149
|
+
it('links to the CMS and the version history only when it has them', async () => {
|
|
150
|
+
await mount();
|
|
151
|
+
expect(container.querySelector('a')).toBeNull();
|
|
152
|
+
await mount({ cmsUrl: '/admin/pages/1', historyUrl: '/admin/pages/1/versions' });
|
|
153
|
+
const links = [...container.querySelectorAll('a')];
|
|
154
|
+
expect(links.map((a) => a.getAttribute('href'))).toEqual([
|
|
155
|
+
'/admin/pages/1',
|
|
156
|
+
'/admin/pages/1/versions',
|
|
157
|
+
]);
|
|
158
|
+
expect(links[0]?.getAttribute('aria-label')).toBe('Back to CMS');
|
|
159
|
+
expect(links[1]?.getAttribute('aria-label')).toBe('Version history');
|
|
160
|
+
});
|
|
161
|
+
it('has no accessibility violations', async () => {
|
|
162
|
+
await mount({
|
|
163
|
+
cmsUrl: '/admin',
|
|
164
|
+
historyUrl: '/versions',
|
|
165
|
+
onPreview: () => undefined,
|
|
166
|
+
onPublish: () => undefined,
|
|
167
|
+
});
|
|
168
|
+
expect(await axe(container)).toHaveNoViolations();
|
|
169
|
+
});
|
|
170
|
+
it('names the buttons without the shortcuts, which appear in the tooltips', async () => {
|
|
171
|
+
await mount();
|
|
172
|
+
const undo = byName('Undo');
|
|
173
|
+
expect(undo.getAttribute('aria-label')).toBe('Undo');
|
|
174
|
+
await act(async () => {
|
|
175
|
+
undo.focus();
|
|
176
|
+
undo.dispatchEvent(new FocusEvent('focusin', { bubbles: true }));
|
|
177
|
+
});
|
|
178
|
+
await act(async () => {
|
|
179
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
180
|
+
});
|
|
181
|
+
// Radix opens the tooltip on keyboard focus; its text carries the shortcut.
|
|
182
|
+
const tip = document.querySelector('[role=tooltip]');
|
|
183
|
+
expect(tip?.textContent).toContain('Ctrl+Z');
|
|
184
|
+
});
|
|
185
|
+
const menuButtons = () => [...document.querySelectorAll('.bd-menu-list button')];
|
|
186
|
+
const openMore = async () => act(async () => byName('More actions').click());
|
|
187
|
+
it('shows the breakpoints as icon buttons with the width in the tooltip', async () => {
|
|
188
|
+
await mount({ breakpoint: 'tablet' });
|
|
189
|
+
const tablet = byName('Tablet');
|
|
190
|
+
expect(tablet.textContent).toBe('');
|
|
191
|
+
expect(tablet.querySelector('svg')).not.toBeNull();
|
|
192
|
+
await act(async () => {
|
|
193
|
+
tablet.focus();
|
|
194
|
+
tablet.dispatchEvent(new FocusEvent('focusin', { bubbles: true }));
|
|
195
|
+
});
|
|
196
|
+
await act(async () => {
|
|
197
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
198
|
+
});
|
|
199
|
+
expect(document.querySelector('[role=tooltip]')?.textContent).toContain('Tablet · 820px');
|
|
200
|
+
});
|
|
201
|
+
it('shows the status pill of the document', async () => {
|
|
202
|
+
await mount({ status: 'published' });
|
|
203
|
+
expect(container.querySelector('.bd-status-pill')?.textContent).toBe('Published');
|
|
204
|
+
});
|
|
205
|
+
it('changes the zoom through the menu', async () => {
|
|
206
|
+
const onZoomChange = vi.fn();
|
|
207
|
+
await mount({ onZoomChange, zoom: 'fit' });
|
|
208
|
+
const trigger = byName('Zoom');
|
|
209
|
+
expect(trigger.getAttribute('aria-label')).toBe('Zoom: Fit');
|
|
210
|
+
await act(async () => trigger.click());
|
|
211
|
+
expect(menuButtons().map((b) => b.textContent)).toEqual(['Fit', '50%', '75%', '100%', '125%']);
|
|
212
|
+
await act(async () => menuButtons().find((b) => b.textContent === '75%').click());
|
|
213
|
+
expect(onZoomChange).toHaveBeenCalledWith(0.75);
|
|
214
|
+
});
|
|
215
|
+
it('leaves the zoom menu out without a handler', async () => {
|
|
216
|
+
await mount();
|
|
217
|
+
expect(byName('Zoom')).toBeUndefined();
|
|
218
|
+
});
|
|
219
|
+
it('keeps every action reachable in a narrow row by moving them into the more menu', async () => {
|
|
220
|
+
// jsdom has no layout: the row overflows until the toolbar has collapsed every step.
|
|
221
|
+
const proto = HTMLElement.prototype;
|
|
222
|
+
const client = Object.getOwnPropertyDescriptor(proto, 'clientWidth');
|
|
223
|
+
const scroll = Object.getOwnPropertyDescriptor(proto, 'scrollWidth');
|
|
224
|
+
Object.defineProperty(proto, 'clientWidth', {
|
|
225
|
+
configurable: true,
|
|
226
|
+
get() {
|
|
227
|
+
return this.classList.contains('bd-toolbar-row') ? 1024 : 0;
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
Object.defineProperty(proto, 'scrollWidth', {
|
|
231
|
+
configurable: true,
|
|
232
|
+
get() {
|
|
233
|
+
if (!this.classList.contains('bd-toolbar-row'))
|
|
234
|
+
return 0;
|
|
235
|
+
return 1024 + (4 - Number(this.getAttribute('data-level'))) * 100;
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
try {
|
|
239
|
+
await mount({ cmsUrl: '/admin', historyUrl: '/versions', onPreview: () => undefined });
|
|
240
|
+
expect(container.querySelector('.bd-toolbar-row')?.getAttribute('data-level')).toBe('4');
|
|
241
|
+
expect(container.querySelector('a')).toBeNull();
|
|
242
|
+
await openMore();
|
|
243
|
+
const links = [...document.querySelectorAll('.bd-menu-list a')];
|
|
244
|
+
expect(links.map((a) => a.getAttribute('href'))).toEqual(['/admin', '/versions']);
|
|
245
|
+
expect(document.querySelector('.bd-menu-list')?.textContent).toContain('Keyboard shortcuts');
|
|
246
|
+
for (const name of ['Undo', 'Redo', 'Desktop', 'Tablet', 'Mobile', 'Preview', 'Publish']) {
|
|
247
|
+
expect(byName(name)).toBeDefined();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
finally {
|
|
251
|
+
if (client !== undefined)
|
|
252
|
+
Object.defineProperty(proto, 'clientWidth', client);
|
|
253
|
+
else
|
|
254
|
+
Reflect.deleteProperty(proto, 'clientWidth');
|
|
255
|
+
if (scroll !== undefined)
|
|
256
|
+
Object.defineProperty(proto, 'scrollWidth', scroll);
|
|
257
|
+
else
|
|
258
|
+
Reflect.deleteProperty(proto, 'scrollWidth');
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
it('opens the shortcut help from the more menu', async () => {
|
|
262
|
+
await mount();
|
|
263
|
+
await openMore();
|
|
264
|
+
const item = menuButtons().find((b) => (b.textContent ?? '').includes('Keyboard shortcuts'));
|
|
265
|
+
await act(async () => item.click());
|
|
266
|
+
expect(document.querySelector('[role=dialog]')?.textContent).toContain('Keyboard shortcuts');
|
|
267
|
+
});
|
|
268
|
+
it('switches the theme from the more menu, unless the host fixed it', async () => {
|
|
269
|
+
const setPreference = vi.fn();
|
|
270
|
+
const theme = {
|
|
271
|
+
preference: 'system',
|
|
272
|
+
attribute: 'system',
|
|
273
|
+
forced: false,
|
|
274
|
+
setPreference,
|
|
275
|
+
};
|
|
276
|
+
await mount({}, { theme });
|
|
277
|
+
await openMore();
|
|
278
|
+
const group = document.querySelector('[aria-label=Theme]');
|
|
279
|
+
const choice = (name) => [...(group?.querySelectorAll('button') ?? [])].find((b) => b.textContent?.includes(name));
|
|
280
|
+
expect(choice('System')?.getAttribute('aria-pressed')).toBe('true');
|
|
281
|
+
await act(async () => choice('Dark').click());
|
|
282
|
+
expect(setPreference).toHaveBeenCalledWith('dark');
|
|
283
|
+
await act(async () => root.unmount());
|
|
284
|
+
root = createRoot(container);
|
|
285
|
+
await mount({}, { theme: { ...theme, forced: true, preference: 'dark', attribute: 'dark' } });
|
|
286
|
+
await openMore();
|
|
287
|
+
expect(document.querySelector('[aria-label=Theme]')).toBeNull();
|
|
288
|
+
});
|
|
289
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How many steps of collapsing (0..`max`) the toolbar needs to fit its row. It measures the row
|
|
4
|
+
* itself with a `ResizeObserver`, not the window, because the editor may be embedded in a box of
|
|
5
|
+
* any width. A step is taken when the content overflows; it is undone once the row is as wide as
|
|
6
|
+
* the content was when that step was taken.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useOverflowLevel(ref: RefObject<HTMLElement | null>, max: number): number;
|
|
9
|
+
//# sourceMappingURL=use-overflow-level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-overflow-level.d.ts","sourceRoot":"","sources":["../../src/toolbar/use-overflow-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAgD,MAAM,OAAO,CAAC;AAErF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAkCxF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How many steps of collapsing (0..`max`) the toolbar needs to fit its row. It measures the row
|
|
4
|
+
* itself with a `ResizeObserver`, not the window, because the editor may be embedded in a box of
|
|
5
|
+
* any width. A step is taken when the content overflows; it is undone once the row is as wide as
|
|
6
|
+
* the content was when that step was taken.
|
|
7
|
+
*/
|
|
8
|
+
export function useOverflowLevel(ref, max) {
|
|
9
|
+
const [level, setLevel] = useState(0);
|
|
10
|
+
// The content width at which each level overflowed, to know when it fits again.
|
|
11
|
+
const needed = useRef([]);
|
|
12
|
+
const measure = () => {
|
|
13
|
+
const el = ref.current;
|
|
14
|
+
if (el === null)
|
|
15
|
+
return;
|
|
16
|
+
const room = el.clientWidth;
|
|
17
|
+
if (el.scrollWidth > room + 1 && level < max) {
|
|
18
|
+
needed.current[level] = el.scrollWidth;
|
|
19
|
+
setLevel(level + 1);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const previous = needed.current[level - 1];
|
|
23
|
+
if (level > 0 && previous !== undefined && room >= previous)
|
|
24
|
+
setLevel(level - 1);
|
|
25
|
+
};
|
|
26
|
+
const latest = useRef(measure);
|
|
27
|
+
latest.current = measure;
|
|
28
|
+
// Every commit: a new level, a longer title or a picker that appeared can all change the width.
|
|
29
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: `measure` is redefined each render on purpose
|
|
30
|
+
useLayoutEffect(measure);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
const el = ref.current;
|
|
33
|
+
if (el === null || typeof ResizeObserver === 'undefined')
|
|
34
|
+
return;
|
|
35
|
+
const observer = new ResizeObserver(() => latest.current());
|
|
36
|
+
observer.observe(el);
|
|
37
|
+
return () => observer.disconnect();
|
|
38
|
+
}, [ref]);
|
|
39
|
+
return level;
|
|
40
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Zoom = 'fit' | number;
|
|
2
|
+
/** The zoom levels the menu offers; `host.setZoom` takes the scale as a fraction (1 is 100%). */
|
|
3
|
+
export declare const ZOOM_LEVELS: readonly Zoom[];
|
|
4
|
+
export interface ZoomMenuProps {
|
|
5
|
+
readonly zoom: Zoom;
|
|
6
|
+
readonly onChange: (zoom: Zoom) => void;
|
|
7
|
+
}
|
|
8
|
+
/** The canvas zoom: Fit, 50, 75, 100 and 125 percent (the host's `setZoom`). */
|
|
9
|
+
export declare function ZoomMenu({ zoom, onChange }: ZoomMenuProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=zoom-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-menu.d.ts","sourceRoot":"","sources":["../../src/toolbar/zoom-menu.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;AAElC,iGAAiG;AACjG,eAAO,MAAM,WAAW,EAAE,SAAS,IAAI,EAAgC,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACzC;AAID,gFAAgF;AAChF,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAuCzD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useT } from '../messages/index.js';
|
|
4
|
+
import { Button, Icon, Popover } from '../ui/index.js';
|
|
5
|
+
/** The zoom levels the menu offers; `host.setZoom` takes the scale as a fraction (1 is 100%). */
|
|
6
|
+
export const ZOOM_LEVELS = ['fit', 0.5, 0.75, 1, 1.25];
|
|
7
|
+
const percent = (zoom) => `${Math.round(zoom * 100)}%`;
|
|
8
|
+
/** The canvas zoom: Fit, 50, 75, 100 and 125 percent (the host's `setZoom`). */
|
|
9
|
+
export function ZoomMenu({ zoom, onChange }) {
|
|
10
|
+
const t = useT();
|
|
11
|
+
const [open, setOpen] = useState(false);
|
|
12
|
+
const text = (value) => (value === 'fit' ? t('toolbar.zoom.fit') : percent(value));
|
|
13
|
+
return (_jsx(Popover, { open: open, onOpenChange: setOpen, contentClassName: "bd-menu-popover", label: t('toolbar.zoom'), trigger: _jsxs(Button, { variant: "ghost", className: "bd-zoom-trigger bd-tabular", "aria-label": `${t('toolbar.zoom')}: ${text(zoom)}`, children: [_jsx("span", { "aria-hidden": "true", children: text(zoom) }), _jsx(Icon, { name: "chevron-down" })] }), children: _jsx("div", { className: "bd-menu-list", children: ZOOM_LEVELS.map((level) => (_jsx("button", { type: "button", className: "bd-menu-item bd-tabular", "aria-pressed": level === zoom, onClick: () => {
|
|
14
|
+
onChange(level);
|
|
15
|
+
setOpen(false);
|
|
16
|
+
}, children: text(level) }, level))) }) }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type LucideIcon } from 'lucide-react';
|
|
2
|
+
/** The icons the editor's own chrome uses. */
|
|
3
|
+
declare const EDITOR_ICONS: {
|
|
4
|
+
readonly 'text-align-center': LucideIcon;
|
|
5
|
+
readonly 'align-center-vertical': LucideIcon;
|
|
6
|
+
readonly 'align-end-vertical': LucideIcon;
|
|
7
|
+
readonly 'align-horizontal-justify-center': LucideIcon;
|
|
8
|
+
readonly 'align-horizontal-justify-end': LucideIcon;
|
|
9
|
+
readonly 'align-horizontal-justify-start': LucideIcon;
|
|
10
|
+
readonly 'align-horizontal-space-around': LucideIcon;
|
|
11
|
+
readonly 'align-horizontal-space-between': LucideIcon;
|
|
12
|
+
readonly 'text-align-justify': LucideIcon;
|
|
13
|
+
readonly 'text-align-start': LucideIcon;
|
|
14
|
+
readonly 'text-align-end': LucideIcon;
|
|
15
|
+
readonly 'align-start-vertical': LucideIcon;
|
|
16
|
+
readonly 'arrow-right': LucideIcon;
|
|
17
|
+
readonly braces: LucideIcon;
|
|
18
|
+
readonly calendar: LucideIcon;
|
|
19
|
+
readonly database: LucideIcon;
|
|
20
|
+
readonly hash: LucideIcon;
|
|
21
|
+
readonly image: LucideIcon;
|
|
22
|
+
readonly sigma: LucideIcon;
|
|
23
|
+
readonly 'stretch-vertical': LucideIcon;
|
|
24
|
+
readonly 'toggle-left': LucideIcon;
|
|
25
|
+
readonly type: LucideIcon;
|
|
26
|
+
readonly ban: LucideIcon;
|
|
27
|
+
readonly 'case-lower': LucideIcon;
|
|
28
|
+
readonly 'case-sensitive': LucideIcon;
|
|
29
|
+
readonly 'case-upper': LucideIcon;
|
|
30
|
+
readonly italic: LucideIcon;
|
|
31
|
+
readonly 'link-2': LucideIcon;
|
|
32
|
+
readonly strikethrough: LucideIcon;
|
|
33
|
+
readonly underline: LucideIcon;
|
|
34
|
+
readonly 'unlink-2': LucideIcon;
|
|
35
|
+
readonly 'arrow-down': LucideIcon;
|
|
36
|
+
readonly 'arrow-left': LucideIcon;
|
|
37
|
+
readonly 'arrow-up': LucideIcon;
|
|
38
|
+
readonly box: LucideIcon;
|
|
39
|
+
readonly check: LucideIcon;
|
|
40
|
+
readonly 'chevron-down': LucideIcon;
|
|
41
|
+
readonly 'chevron-right': LucideIcon;
|
|
42
|
+
readonly circle: LucideIcon;
|
|
43
|
+
readonly copy: LucideIcon;
|
|
44
|
+
readonly 'circle-alert': LucideIcon;
|
|
45
|
+
readonly 'circle-check': LucideIcon;
|
|
46
|
+
readonly ellipsis: LucideIcon;
|
|
47
|
+
readonly eye: LucideIcon;
|
|
48
|
+
readonly history: LucideIcon;
|
|
49
|
+
readonly keyboard: LucideIcon;
|
|
50
|
+
readonly 'layout-grid': LucideIcon;
|
|
51
|
+
readonly info: LucideIcon;
|
|
52
|
+
readonly link: LucideIcon;
|
|
53
|
+
readonly list: LucideIcon;
|
|
54
|
+
readonly 'list-ordered': LucideIcon;
|
|
55
|
+
readonly 'loader-circle': LucideIcon;
|
|
56
|
+
readonly lock: LucideIcon;
|
|
57
|
+
readonly monitor: LucideIcon;
|
|
58
|
+
readonly 'monitor-smartphone': LucideIcon;
|
|
59
|
+
readonly moon: LucideIcon;
|
|
60
|
+
readonly 'mouse-pointer-click': LucideIcon;
|
|
61
|
+
readonly 'panel-left': LucideIcon;
|
|
62
|
+
readonly 'panel-right': LucideIcon;
|
|
63
|
+
readonly 'redo-2': LucideIcon;
|
|
64
|
+
readonly 'rotate-ccw': LucideIcon;
|
|
65
|
+
readonly smartphone: LucideIcon;
|
|
66
|
+
readonly sun: LucideIcon;
|
|
67
|
+
readonly tablet: LucideIcon;
|
|
68
|
+
readonly 'trash-2': LucideIcon;
|
|
69
|
+
readonly search: LucideIcon;
|
|
70
|
+
readonly 'triangle-alert': LucideIcon;
|
|
71
|
+
readonly 'undo-2': LucideIcon;
|
|
72
|
+
readonly x: LucideIcon;
|
|
73
|
+
};
|
|
74
|
+
export type IconName = keyof typeof EDITOR_ICONS;
|
|
75
|
+
/** The names `ComponentIcon` resolves (everything else shows the neutral `box`). */
|
|
76
|
+
export declare const componentIconNames: readonly string[];
|
|
77
|
+
declare const SIZES: {
|
|
78
|
+
readonly sm: 16;
|
|
79
|
+
readonly md: 20;
|
|
80
|
+
};
|
|
81
|
+
export interface IconProps {
|
|
82
|
+
readonly name: IconName;
|
|
83
|
+
/** 16px in dense rows (default), 20px in palette tiles. */
|
|
84
|
+
readonly size?: keyof typeof SIZES;
|
|
85
|
+
/** Makes the icon meaningful (`role="img"` with this name); without it the icon is decorative. */
|
|
86
|
+
readonly label?: string | undefined;
|
|
87
|
+
readonly className?: string;
|
|
88
|
+
}
|
|
89
|
+
/** One of the editor's own icons, drawn in `currentColor`. */
|
|
90
|
+
export declare function Icon({ name, size, label, className }: IconProps): import("react").JSX.Element;
|
|
91
|
+
export interface ComponentIconProps {
|
|
92
|
+
/** A component's metadata (only `icon` is read). */
|
|
93
|
+
readonly meta: {
|
|
94
|
+
readonly icon?: string | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
readonly size?: keyof typeof SIZES;
|
|
97
|
+
readonly className?: string;
|
|
98
|
+
}
|
|
99
|
+
/** The icon of a component; a missing or unknown name gives a neutral box, never a letter. */
|
|
100
|
+
export declare function ComponentIcon({ meta, size, className }: ComponentIconProps): import("react").JSX.Element;
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/ui/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAiEL,KAAK,UAAU,EAgEhB,MAAM,cAAc,CAAC;AAStB,8CAA8C;AAC9C,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsE6B,CAAC;AAEhD,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,YAAY,CAAC;AAwFjD,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAAiC,CAAC;AAElF,QAAA,MAAM,KAAK;aAAK,EAAE,EAAE,EAAE;aAAE,EAAE,EAAE,EAAE;CAAW,CAAC;AAG1C,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IACnC,kGAAkG;IAClG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAuBD,8DAA8D;AAC9D,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,IAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,+BAEtE;AAED,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GAAG,SAAS,CAAC;IAClE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAYjF"}
|