@blokkli/editor 1.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/README.md +64 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +129 -0
- package/dist/module.d.ts +129 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +5430 -0
- package/dist/runtime/adapter/drupal/graphql/base.graphql +906 -0
- package/dist/runtime/adapter/drupal/graphql/comments.graphql +56 -0
- package/dist/runtime/adapter/drupal/graphql/fragments.graphql +25 -0
- package/dist/runtime/adapter/drupal/graphql/library.graphql +66 -0
- package/dist/runtime/adapter/drupal/graphql/search.graphql +19 -0
- package/dist/runtime/adapter/drupal/graphql/transform.graphql +27 -0
- package/dist/runtime/adapter/drupal/graphqlMiddleware.d.ts +2 -0
- package/dist/runtime/adapter/drupal/graphqlMiddleware.js +643 -0
- package/dist/runtime/adapter/index.d.ts +352 -0
- package/dist/runtime/adapter/index.js +3 -0
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +87 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +95 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +49 -0
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue +34 -0
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +73 -0
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +132 -0
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +42 -0
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +74 -0
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +334 -0
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +286 -0
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +104 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +45 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +106 -0
- package/dist/runtime/blokkliPlugins/index.d.ts +12 -0
- package/dist/runtime/blokkliPlugins/index.js +24 -0
- package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -0
- package/dist/runtime/components/Blocks/Fragment/index.vue +24 -0
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +58 -0
- package/dist/runtime/components/BlokkliEditable.vue +73 -0
- package/dist/runtime/components/BlokkliField.vue +157 -0
- package/dist/runtime/components/BlokkliItem.vue +79 -0
- package/dist/runtime/components/BlokkliProvider.vue +160 -0
- package/dist/runtime/components/Edit/Actions/index.vue +263 -0
- package/dist/runtime/components/Edit/AddListItem/index.vue +116 -0
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +122 -0
- package/dist/runtime/components/Edit/AppMenu/index.vue +60 -0
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +64 -0
- package/dist/runtime/components/Edit/Dialog/index.vue +163 -0
- package/dist/runtime/components/Edit/DragInteractions/index.vue +439 -0
- package/dist/runtime/components/Edit/DraggableList.vue +110 -0
- package/dist/runtime/components/Edit/EditIndicator.vue +82 -0
- package/dist/runtime/components/Edit/EditProvider.vue +213 -0
- package/dist/runtime/components/Edit/Features/AddList/docs.md +4 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +205 -0
- package/dist/runtime/components/Edit/Features/Artboard/Manager/Artboard.d.ts +204 -0
- package/dist/runtime/components/Edit/Features/Artboard/Manager/Artboard.js +748 -0
- package/dist/runtime/components/Edit/Features/Artboard/Manager/Scrollbar/index.vue +176 -0
- package/dist/runtime/components/Edit/Features/Artboard/Manager/index.vue +317 -0
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +45 -0
- package/dist/runtime/components/Edit/Features/Assistant/Overlay/ResultMarkup/index.vue +17 -0
- package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +147 -0
- package/dist/runtime/components/Edit/Features/Assistant/docs.md +7 -0
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +68 -0
- package/dist/runtime/components/Edit/Features/BlockAddList/docs.md +15 -0
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +440 -0
- package/dist/runtime/components/Edit/Features/Clipboard/List/Item/File.vue +68 -0
- package/dist/runtime/components/Edit/Features/Clipboard/List/Item/Video.vue +56 -0
- package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +69 -0
- package/dist/runtime/components/Edit/Features/Clipboard/docs.md +16 -0
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +485 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +61 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +280 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +51 -0
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +32 -0
- package/dist/runtime/components/Edit/Features/Comments/Comment/index.vue +53 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +100 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +133 -0
- package/dist/runtime/components/Edit/Features/Comments/docs.md +13 -0
- package/dist/runtime/components/Edit/Features/Comments/index.vue +110 -0
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +98 -0
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +55 -0
- package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +93 -0
- package/dist/runtime/components/Edit/Features/Debug/docs.md +3 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +178 -0
- package/dist/runtime/components/Edit/Features/Delete/index.vue +43 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +420 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +58 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +808 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +57 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +410 -0
- package/dist/runtime/components/Edit/Features/Duplicate/index.vue +109 -0
- package/dist/runtime/components/Edit/Features/Edit/index.vue +63 -0
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +73 -0
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +217 -0
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Contenteditable/index.vue +42 -0
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +68 -0
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +81 -0
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +357 -0
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +192 -0
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +64 -0
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +108 -0
- package/dist/runtime/components/Edit/Features/Exit/index.vue +38 -0
- package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +33 -0
- package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +43 -0
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +68 -0
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +137 -0
- package/dist/runtime/components/Edit/Features/Fragments/docs.md +101 -0
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +86 -0
- package/dist/runtime/components/Edit/Features/Grid/index.vue +40 -0
- package/dist/runtime/components/Edit/Features/Help/Shortcuts/index.vue +71 -0
- package/dist/runtime/components/Edit/Features/Help/index.vue +53 -0
- package/dist/runtime/components/Edit/Features/History/index.vue +263 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +140 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +92 -0
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +0 -0
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +73 -0
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +184 -0
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +88 -0
- package/dist/runtime/components/Edit/Features/Library/docs.md +127 -0
- package/dist/runtime/components/Edit/Features/Library/index.vue +184 -0
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +184 -0
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +182 -0
- package/dist/runtime/components/Edit/Features/MediaLibrary/types.d.ts +57 -0
- package/dist/runtime/components/Edit/Features/MediaLibrary/types.js +0 -0
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +90 -0
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +289 -0
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +182 -0
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +76 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +52 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Checkboxes/index.vue +129 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Color/index.vue +38 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Group.vue +25 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +155 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Number/index.vue +74 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +135 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Range/index.vue +47 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Text/index.vue +38 -0
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +342 -0
- package/dist/runtime/components/Edit/Features/Options/index.vue +88 -0
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +57 -0
- package/dist/runtime/components/Edit/Features/Preview/index.vue +45 -0
- package/dist/runtime/components/Edit/Features/PreviewGrant/QrCode/index.vue +30 -0
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +73 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +50 -0
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +81 -0
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +217 -0
- package/dist/runtime/components/Edit/Features/Revert/index.vue +68 -0
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +165 -0
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +211 -0
- package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +214 -0
- package/dist/runtime/components/Edit/Features/Search/index.vue +79 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +99 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +144 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +85 -0
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +50 -0
- package/dist/runtime/components/Edit/Features/Selection/index.vue +295 -0
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +141 -0
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +138 -0
- package/dist/runtime/components/Edit/Features/Settings/index.vue +92 -0
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +181 -0
- package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +149 -0
- package/dist/runtime/components/Edit/Features/Structure/List/index.vue +55 -0
- package/dist/runtime/components/Edit/Features/Structure/index.vue +83 -0
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +81 -0
- package/dist/runtime/components/Edit/Features/Theme/GeneratedCode/index.vue +24 -0
- package/dist/runtime/components/Edit/Features/Theme/index.vue +122 -0
- package/dist/runtime/components/Edit/Features/TouchActionBar/Bar/index.vue +26 -0
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +42 -0
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +270 -0
- package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +36 -0
- package/dist/runtime/components/Edit/Features/Tour/docs.md +0 -0
- package/dist/runtime/components/Edit/Features/Tour/index.vue +46 -0
- package/dist/runtime/components/Edit/Features/Transform/docs.md +67 -0
- package/dist/runtime/components/Edit/Features/Transform/index.vue +177 -0
- package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +50 -0
- package/dist/runtime/components/Edit/Features/Translations/index.vue +193 -0
- package/dist/runtime/components/Edit/Features/Validations/Overlay/Item.vue +50 -0
- package/dist/runtime/components/Edit/Features/Validations/Overlay/index.vue +51 -0
- package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +50 -0
- package/dist/runtime/components/Edit/Features/Validations/index.vue +70 -0
- package/dist/runtime/components/Edit/Features/index.vue +67 -0
- package/dist/runtime/components/Edit/FormOverlay/Header/index.vue +39 -0
- package/dist/runtime/components/Edit/FormOverlay/index.vue +52 -0
- package/dist/runtime/components/Edit/Highlight/index.vue +94 -0
- package/dist/runtime/components/Edit/Icon/index.vue +21 -0
- package/dist/runtime/components/Edit/ItemIcon/index.vue +27 -0
- package/dist/runtime/components/Edit/Loading/index.vue +19 -0
- package/dist/runtime/components/Edit/Messages/Item/index.vue +107 -0
- package/dist/runtime/components/Edit/Messages/index.vue +37 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +223 -0
- package/dist/runtime/components/Edit/RelativeTime/index.vue +37 -0
- package/dist/runtime/components/Edit/Resizable/index.vue +90 -0
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +57 -0
- package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +90 -0
- package/dist/runtime/components/Edit/Sortli/index.vue +92 -0
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +91 -0
- package/dist/runtime/components/Edit/Toolbar/index.vue +106 -0
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue +75 -0
- package/dist/runtime/components/Edit/index.d.ts +14 -0
- package/dist/runtime/components/Edit/index.js +28 -0
- package/dist/runtime/composables/defineBlokkli.d.ts +6 -0
- package/dist/runtime/composables/defineBlokkli.js +108 -0
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +28 -0
- package/dist/runtime/composables/defineBlokkliFeature.js +62 -0
- package/dist/runtime/composables/defineBlokkliFragment.d.ts +3 -0
- package/dist/runtime/composables/defineBlokkliFragment.js +54 -0
- package/dist/runtime/composables/useBlokkli.d.ts +8 -0
- package/dist/runtime/composables/useBlokkli.js +5 -0
- package/dist/runtime/constants/index.d.ts +4 -0
- package/dist/runtime/constants/index.js +2 -0
- package/dist/runtime/css/output.css +1 -0
- package/dist/runtime/helpers/Artboard/index.d.ts +16 -0
- package/dist/runtime/helpers/Artboard/index.js +20 -0
- package/dist/runtime/helpers/DragStyle/index.d.ts +12 -0
- package/dist/runtime/helpers/DragStyle/index.js +86 -0
- package/dist/runtime/helpers/animationProvider.d.ts +25 -0
- package/dist/runtime/helpers/animationProvider.js +116 -0
- package/dist/runtime/helpers/broadcastProvider.d.ts +7 -0
- package/dist/runtime/helpers/broadcastProvider.js +26 -0
- package/dist/runtime/helpers/commandsProvider.d.ts +9 -0
- package/dist/runtime/helpers/commandsProvider.js +16 -0
- package/dist/runtime/helpers/composables/defineCommands.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineCommands.js +10 -0
- package/dist/runtime/helpers/composables/defineDropAreas.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineDropAreas.js +10 -0
- package/dist/runtime/helpers/composables/defineShortcut.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineShortcut.js +19 -0
- package/dist/runtime/helpers/composables/defineTourItem.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineTourItem.js +10 -0
- package/dist/runtime/helpers/composables/onBlokkliEvent.d.ts +2 -0
- package/dist/runtime/helpers/composables/onBlokkliEvent.js +10 -0
- package/dist/runtime/helpers/composables/useAnimationFrame.d.ts +1 -0
- package/dist/runtime/helpers/composables/useAnimationFrame.js +14 -0
- package/dist/runtime/helpers/composables/useDebugLogger.d.ts +2 -0
- package/dist/runtime/helpers/composables/useDebugLogger.js +5 -0
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +5 -0
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +26 -0
- package/dist/runtime/helpers/debugProvider.d.ts +23 -0
- package/dist/runtime/helpers/debugProvider.js +65 -0
- package/dist/runtime/helpers/dom/index.d.ts +5 -0
- package/dist/runtime/helpers/dom/index.js +37 -0
- package/dist/runtime/helpers/domProvider.d.ts +46 -0
- package/dist/runtime/helpers/domProvider.js +446 -0
- package/dist/runtime/helpers/dropAreaProvider.d.ts +9 -0
- package/dist/runtime/helpers/dropAreaProvider.js +22 -0
- package/dist/runtime/helpers/easing.d.ts +3 -0
- package/dist/runtime/helpers/easing.js +16 -0
- package/dist/runtime/helpers/eventBus.d.ts +3 -0
- package/dist/runtime/helpers/eventBus.js +5 -0
- package/dist/runtime/helpers/featuresProvider.d.ts +23 -0
- package/dist/runtime/helpers/featuresProvider.js +16 -0
- package/dist/runtime/helpers/frameEventBus.d.ts +9 -0
- package/dist/runtime/helpers/frameEventBus.js +2 -0
- package/dist/runtime/helpers/index.d.ts +87 -0
- package/dist/runtime/helpers/index.js +467 -0
- package/dist/runtime/helpers/keyboardProvider.d.ts +17 -0
- package/dist/runtime/helpers/keyboardProvider.js +79 -0
- package/dist/runtime/helpers/options.d.ts +2 -0
- package/dist/runtime/helpers/options.js +21 -0
- package/dist/runtime/helpers/runtimeHelpers/index.d.ts +10 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +35 -0
- package/dist/runtime/helpers/selectionProvider.d.ts +62 -0
- package/dist/runtime/helpers/selectionProvider.js +149 -0
- package/dist/runtime/helpers/stateProvider.d.ts +35 -0
- package/dist/runtime/helpers/stateProvider.js +226 -0
- package/dist/runtime/helpers/storageProvider.d.ts +15 -0
- package/dist/runtime/helpers/storageProvider.js +61 -0
- package/dist/runtime/helpers/symbols.d.ts +16 -0
- package/dist/runtime/helpers/symbols.js +18 -0
- package/dist/runtime/helpers/textProvider.d.ts +4 -0
- package/dist/runtime/helpers/textProvider.js +20 -0
- package/dist/runtime/helpers/themeProvider.d.ts +27 -0
- package/dist/runtime/helpers/themeProvider.js +124 -0
- package/dist/runtime/helpers/tourProvider.d.ts +11 -0
- package/dist/runtime/helpers/tourProvider.js +19 -0
- package/dist/runtime/helpers/transform.d.ts +2 -0
- package/dist/runtime/helpers/transform.js +17 -0
- package/dist/runtime/helpers/typesProvider.d.ts +36 -0
- package/dist/runtime/helpers/typesProvider.js +138 -0
- package/dist/runtime/helpers/uiProvider.d.ts +36 -0
- package/dist/runtime/helpers/uiProvider.js +278 -0
- package/dist/runtime/helpers/webgl/index.d.ts +32 -0
- package/dist/runtime/helpers/webgl/index.js +132 -0
- package/dist/runtime/icons/alert.svg +6 -0
- package/dist/runtime/icons/area.svg +5 -0
- package/dist/runtime/icons/arrow-down.svg +1 -0
- package/dist/runtime/icons/arrow-left.svg +1 -0
- package/dist/runtime/icons/arrow-right.svg +1 -0
- package/dist/runtime/icons/arrow-up.svg +1 -0
- package/dist/runtime/icons/artboard-disabled.svg +9 -0
- package/dist/runtime/icons/artboard-enabled.svg +29 -0
- package/dist/runtime/icons/artboard.svg +1 -0
- package/dist/runtime/icons/bug.svg +1 -0
- package/dist/runtime/icons/button-pointer.svg +1 -0
- package/dist/runtime/icons/caret.svg +12 -0
- package/dist/runtime/icons/cellphone.svg +1 -0
- package/dist/runtime/icons/chat-question.svg +1 -0
- package/dist/runtime/icons/check.svg +1 -0
- package/dist/runtime/icons/checkbox.svg +5 -0
- package/dist/runtime/icons/checks.svg +1 -0
- package/dist/runtime/icons/chevron-left.svg +1 -0
- package/dist/runtime/icons/chevron-right.svg +1 -0
- package/dist/runtime/icons/clipboard.svg +5 -0
- package/dist/runtime/icons/close.svg +5 -0
- package/dist/runtime/icons/cog.svg +5 -0
- package/dist/runtime/icons/command.svg +1 -0
- package/dist/runtime/icons/comment.svg +5 -0
- package/dist/runtime/icons/comment_add.svg +5 -0
- package/dist/runtime/icons/convert.svg +1 -0
- package/dist/runtime/icons/cursor-move.svg +1 -0
- package/dist/runtime/icons/dead.svg +1 -0
- package/dist/runtime/icons/delete.svg +8 -0
- package/dist/runtime/icons/detach.svg +7 -0
- package/dist/runtime/icons/drag.svg +1 -0
- package/dist/runtime/icons/duplicate.svg +12 -0
- package/dist/runtime/icons/edit.svg +8 -0
- package/dist/runtime/icons/exit.svg +6 -0
- package/dist/runtime/icons/expand.svg +1 -0
- package/dist/runtime/icons/file.svg +1 -0
- package/dist/runtime/icons/form.svg +1 -0
- package/dist/runtime/icons/fragment.svg +1 -0
- package/dist/runtime/icons/grid.svg +13 -0
- package/dist/runtime/icons/group.svg +5 -0
- package/dist/runtime/icons/help.svg +1 -0
- package/dist/runtime/icons/history.svg +1 -0
- package/dist/runtime/icons/image.svg +1 -0
- package/dist/runtime/icons/import.svg +5 -0
- package/dist/runtime/icons/laptop.svg +1 -0
- package/dist/runtime/icons/list-view-grid.svg +1 -0
- package/dist/runtime/icons/list-view-horizontal.svg +1 -0
- package/dist/runtime/icons/loader.svg +1 -0
- package/dist/runtime/icons/logo.svg +5 -0
- package/dist/runtime/icons/magnifier.svg +5 -0
- package/dist/runtime/icons/menu.svg +1 -0
- package/dist/runtime/icons/minus.svg +1 -0
- package/dist/runtime/icons/monitor.svg +1 -0
- package/dist/runtime/icons/multi-select.svg +1 -0
- package/dist/runtime/icons/multimedia.svg +1 -0
- package/dist/runtime/icons/opacity.svg +5 -0
- package/dist/runtime/icons/open_in_new.svg +3 -0
- package/dist/runtime/icons/palette.svg +1 -0
- package/dist/runtime/icons/plus-box.svg +1 -0
- package/dist/runtime/icons/plus.svg +1 -0
- package/dist/runtime/icons/preview.svg +5 -0
- package/dist/runtime/icons/publish.svg +12 -0
- package/dist/runtime/icons/puzzle.svg +1 -0
- package/dist/runtime/icons/qrcode.svg +5 -0
- package/dist/runtime/icons/question.svg +5 -0
- package/dist/runtime/icons/redo.svg +12 -0
- package/dist/runtime/icons/resize.svg +1 -0
- package/dist/runtime/icons/reusable.svg +5 -0
- package/dist/runtime/icons/revert.svg +5 -0
- package/dist/runtime/icons/robot.svg +1 -0
- package/dist/runtime/icons/rotate-phone.svg +1 -0
- package/dist/runtime/icons/sad.svg +1 -0
- package/dist/runtime/icons/save.svg +1 -0
- package/dist/runtime/icons/script.svg +1 -0
- package/dist/runtime/icons/scrolltotop.svg +6 -0
- package/dist/runtime/icons/search.svg +1 -0
- package/dist/runtime/icons/selection.svg +5 -0
- package/dist/runtime/icons/spinner.svg +15 -0
- package/dist/runtime/icons/star.svg +1 -0
- package/dist/runtime/icons/swap-horizontal.svg +1 -0
- package/dist/runtime/icons/tablet.svg +1 -0
- package/dist/runtime/icons/textbox.svg +1 -0
- package/dist/runtime/icons/texturebox.svg +5 -0
- package/dist/runtime/icons/tiktok.svg +1 -0
- package/dist/runtime/icons/title.svg +1 -0
- package/dist/runtime/icons/tools.svg +1 -0
- package/dist/runtime/icons/translate.svg +5 -0
- package/dist/runtime/icons/tree.svg +5 -0
- package/dist/runtime/icons/tutor.svg +1 -0
- package/dist/runtime/icons/ui-list-horizontal.svg +19 -0
- package/dist/runtime/icons/ui-list-sidebar.svg +21 -0
- package/dist/runtime/icons/ui-list-vertical.svg +9 -0
- package/dist/runtime/icons/undo.svg +12 -0
- package/dist/runtime/icons/unstar.svg +1 -0
- package/dist/runtime/icons/upload.svg +1 -0
- package/dist/runtime/icons/user.svg +1 -0
- package/dist/runtime/icons/video-outline.svg +1 -0
- package/dist/runtime/icons/vimeo.svg +3 -0
- package/dist/runtime/icons/window-maximize.svg +1 -0
- package/dist/runtime/icons/window-minimize.svg +1 -0
- package/dist/runtime/icons/youtube.svg +3 -0
- package/dist/runtime/plugins/blokkliEditable.d.ts +2 -0
- package/dist/runtime/plugins/blokkliEditable.js +31 -0
- package/dist/runtime/public/Inter.var.woff2 +0 -0
- package/dist/runtime/types/blokkOptions.d.ts +83 -0
- package/dist/runtime/types/blokkOptions.js +0 -0
- package/dist/runtime/types/generatedModuleTypes.d.ts +41 -0
- package/dist/runtime/types/generatedModuleTypes.js +0 -0
- package/dist/runtime/types/index.d.ts +1052 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/theme.d.ts +33 -0
- package/dist/runtime/types/theme.js +0 -0
- package/dist/types.d.mts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +103 -0
|
@@ -0,0 +1,1052 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { Emitter } from 'mitt';
|
|
3
|
+
import type { DomProvider } from '../helpers/domProvider.js';
|
|
4
|
+
import type { StorageProvider } from '../helpers/storageProvider.js';
|
|
5
|
+
import type { BlockDefinitionProvider } from '../helpers/typesProvider.js';
|
|
6
|
+
import type { SelectionProvider } from '../helpers/selectionProvider.js';
|
|
7
|
+
import type { KeyboardProvider } from '../helpers/keyboardProvider.js';
|
|
8
|
+
import type { UiProvider } from '../helpers/uiProvider.js';
|
|
9
|
+
import type { AnimationProvider } from '../helpers/animationProvider.js';
|
|
10
|
+
import type { StateProvider } from '../helpers/stateProvider.js';
|
|
11
|
+
import type { TextProvider } from '../helpers/textProvider.js';
|
|
12
|
+
import type { eventBus } from './../helpers/eventBus.js';
|
|
13
|
+
import type { BlockOptionDefinition } from './blokkOptions.js';
|
|
14
|
+
import type { BlokkliAdapter, AdapterContext, MutationResponseLike } from './../adapter.js';
|
|
15
|
+
import type { BroadcastProvider } from '#blokkli/helpers/broadcastProvider';
|
|
16
|
+
import type { FeaturesProvider } from '#blokkli/helpers/featuresProvider';
|
|
17
|
+
import type { BlokkliIcon } from '#blokkli/icons';
|
|
18
|
+
import type { SettingsGroup, Viewport } from '#blokkli/constants';
|
|
19
|
+
import type { BlockBundleWithNested, FieldListItemTyped, GlobalOptionsKey, ValidChunkNames, ValidFieldListTypes, ValidGlobalConfigKeys } from '#blokkli/generated-types';
|
|
20
|
+
import type { globalOptions } from '#blokkli/definitions';
|
|
21
|
+
import type { ThemeProvider } from '#blokkli/helpers/themeProvider';
|
|
22
|
+
import type { CommandsProvider } from '#blokkli/helpers/commandsProvider';
|
|
23
|
+
import type { TourProvider } from '#blokkli/helpers/tourProvider';
|
|
24
|
+
import type { DropAreaProvider } from '#blokkli/helpers/dropAreaProvider';
|
|
25
|
+
import type { RGB } from './theme.js';
|
|
26
|
+
import type { DebugProvider } from '#blokkli/helpers/debugProvider';
|
|
27
|
+
import type getVideoId from 'get-video-id';
|
|
28
|
+
export type MutateWithLoadingStateFunction = (promise: () => Promise<MutationResponseLike<any>> | undefined, errorMessage?: string, successMessage?: string) => Promise<boolean>;
|
|
29
|
+
type GetType<T> = T extends {
|
|
30
|
+
options: infer O;
|
|
31
|
+
} ? T extends {
|
|
32
|
+
type: 'checkboxes';
|
|
33
|
+
} ? Array<keyof O> : keyof O : T extends {
|
|
34
|
+
type: 'checkbox';
|
|
35
|
+
} ? boolean : T extends {
|
|
36
|
+
type: 'range';
|
|
37
|
+
} ? number : T extends {
|
|
38
|
+
type: 'number';
|
|
39
|
+
} ? number : string;
|
|
40
|
+
export type BlockDefinitionOptionsInput = {
|
|
41
|
+
[key: string]: BlockOptionDefinition;
|
|
42
|
+
};
|
|
43
|
+
type WithOptions<T extends BlockDefinitionOptionsInput> = {
|
|
44
|
+
[K in keyof T]: GetType<T[K]>;
|
|
45
|
+
};
|
|
46
|
+
type GlobalOptionsType = typeof globalOptions;
|
|
47
|
+
type GlobalOptionsKeyTypes<T extends ValidGlobalConfigKeys> = {
|
|
48
|
+
[K in T[number]]: GetType<GlobalOptionsType[K]>;
|
|
49
|
+
};
|
|
50
|
+
export type DefineBlokkliContext<T extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, G extends ValidGlobalConfigKeys | undefined = undefined> = {
|
|
51
|
+
/**
|
|
52
|
+
* The UUID of the item.
|
|
53
|
+
*/
|
|
54
|
+
uuid: string;
|
|
55
|
+
/**
|
|
56
|
+
* The index of the item in the field list.
|
|
57
|
+
*/
|
|
58
|
+
index: ComputedRef<number>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the item is being displayed in an editing context.
|
|
61
|
+
*/
|
|
62
|
+
isEditing: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The item type name (e.g. "teaser_list") of the parent item if this item is nested.
|
|
65
|
+
*/
|
|
66
|
+
parentType: ComputedRef<BlockBundleWithNested | undefined>;
|
|
67
|
+
/**
|
|
68
|
+
* The type of the field list the item is part of.
|
|
69
|
+
*/
|
|
70
|
+
fieldListType: ComputedRef<ValidFieldListTypes>;
|
|
71
|
+
/**
|
|
72
|
+
* All sibling blocks (including this one) that are in the same field.
|
|
73
|
+
*/
|
|
74
|
+
siblings: ComputedRef<FieldListItemTyped[]>;
|
|
75
|
+
/**
|
|
76
|
+
* All blocks that are in the root field (direct child of <BlokkliProvider>).
|
|
77
|
+
*/
|
|
78
|
+
rootBlocks: ComputedRef<FieldListItemTyped[]>;
|
|
79
|
+
/**
|
|
80
|
+
* The reactive runtime options.
|
|
81
|
+
*
|
|
82
|
+
* This includes both the locally defined options and the inherited global
|
|
83
|
+
* options.
|
|
84
|
+
*/
|
|
85
|
+
options: ComputedRef<(T extends BlockDefinitionOptionsInput ? WithOptions<T> : object) & (G extends ValidGlobalConfigKeys ? GlobalOptionsKeyTypes<G> : object)>;
|
|
86
|
+
};
|
|
87
|
+
type DetermineVisibleOptionsContext<T extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, G extends GlobalOptionsKey[] | undefined = undefined> = {
|
|
88
|
+
options: (T extends BlockDefinitionOptionsInput ? WithOptions<T> : object) & (G extends ValidGlobalConfigKeys ? GlobalOptionsKeyTypes<G> : object);
|
|
89
|
+
parentType: BlockBundleWithNested | undefined;
|
|
90
|
+
props: Record<string, any>;
|
|
91
|
+
entity: AdapterContext;
|
|
92
|
+
};
|
|
93
|
+
type ExtractGlobalOptions<G extends GlobalOptionsKey[]> = G[number] extends GlobalOptionsKey ? G[number] : never;
|
|
94
|
+
type CombineKeysAndGlobalOptions<T extends BlockDefinitionOptionsInput, G extends GlobalOptionsKey[] | undefined> = keyof T | ExtractGlobalOptions<NonNullable<G>>;
|
|
95
|
+
export type BlokkliDefinitionAddBehaviour = 'no-form' | 'form' | `editable:${string}`;
|
|
96
|
+
export type BlokkliDefinitionInputEditor<Options extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, GlobalOptions extends GlobalOptionsKey[] | undefined = undefined> = {
|
|
97
|
+
/**
|
|
98
|
+
* Determine which options should be visible in the editor based on the
|
|
99
|
+
* given context.
|
|
100
|
+
*
|
|
101
|
+
* If a method is defined, it is called whenever any of the options change.
|
|
102
|
+
*/
|
|
103
|
+
determineVisibleOptions?: (ctx: DetermineVisibleOptionsContext<Options, GlobalOptions>) => Array<CombineKeysAndGlobalOptions<Options, GlobalOptions>>;
|
|
104
|
+
/**
|
|
105
|
+
* Disable editing for blocks that don't have any editable fields.
|
|
106
|
+
*
|
|
107
|
+
* This disables the "Edit" button in the actions overlay and double click
|
|
108
|
+
* to edit.
|
|
109
|
+
*/
|
|
110
|
+
disableEdit?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* If set, if this block is being rendered standalone (e.g. when inside the
|
|
113
|
+
* "add to library" dialog), the given will be used as the root width. The
|
|
114
|
+
* rendered block is then scaled down so that it fits the available space.
|
|
115
|
+
*/
|
|
116
|
+
previewWidth?: number;
|
|
117
|
+
/**
|
|
118
|
+
* When set to true the preview in the library is not rendered.
|
|
119
|
+
*
|
|
120
|
+
* This should be used for complex components that render things like sliders,
|
|
121
|
+
* iframes, modals, etc.
|
|
122
|
+
*/
|
|
123
|
+
noPreview?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* A background color class that is applied during editing when the component
|
|
126
|
+
* is being displayed standalone in a preview.
|
|
127
|
+
*
|
|
128
|
+
* For example, when the block can be made reusable and is being disabled in
|
|
129
|
+
* the "Add from Library" dialog, the given background class is used on the
|
|
130
|
+
* parent element.
|
|
131
|
+
*
|
|
132
|
+
* This can be used for blocks that render white text and are always
|
|
133
|
+
* rendered on top of a black background. Defining a background class makes
|
|
134
|
+
* sure the text is visible for the user.
|
|
135
|
+
*/
|
|
136
|
+
previewBackgroundClass?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Define the behaviour when a new block is added of this type.
|
|
139
|
+
*
|
|
140
|
+
* Possible options:
|
|
141
|
+
* - 'form' (default)
|
|
142
|
+
* Shows the full form to enter block values.
|
|
143
|
+
* - 'no-form'
|
|
144
|
+
* Immediately adds the block without showing the full form.
|
|
145
|
+
* - 'editable:${string}'
|
|
146
|
+
* Immediately add the block without showing the full form and
|
|
147
|
+
* immediately open the editable field form with the given name.
|
|
148
|
+
* For example, when the block has an editable field named "body"
|
|
149
|
+
* a possible value would be 'editable:body'.
|
|
150
|
+
*/
|
|
151
|
+
addBehaviour?: BlokkliDefinitionAddBehaviour;
|
|
152
|
+
/**
|
|
153
|
+
* Define a custom title for this block at runtime in the editor.
|
|
154
|
+
*
|
|
155
|
+
* The title will be displayed to the editor to give some context. E.g. a
|
|
156
|
+
* title block displays an excerpt from the title.
|
|
157
|
+
*
|
|
158
|
+
* If a method is provided, it receives the root element of this component
|
|
159
|
+
* and should return a fitting title.
|
|
160
|
+
*
|
|
161
|
+
* If no method is defined or it doesn't return a value, the regular label
|
|
162
|
+
* of the bundle (e.g. "Teaser") is displayed.
|
|
163
|
+
*/
|
|
164
|
+
editTitle?: (el: HTMLElement) => string | undefined | null;
|
|
165
|
+
/**
|
|
166
|
+
* Build mock props for this component that are used when this block can
|
|
167
|
+
* be added from clipboard or search text content.
|
|
168
|
+
*
|
|
169
|
+
* The props are then used to render a preview of the block.
|
|
170
|
+
*
|
|
171
|
+
* For example, when pasting text into the editor and if supported by the
|
|
172
|
+
* adapter, the clipboard text content is passed as an argument.
|
|
173
|
+
*/
|
|
174
|
+
mockProps?: (text?: string) => Record<string, any>;
|
|
175
|
+
/**
|
|
176
|
+
* Hides the block from the add list if more than the given amount of
|
|
177
|
+
* blocks aready exist on the page.
|
|
178
|
+
*
|
|
179
|
+
* Note this only affects the behaviour in the editor, it's still possible
|
|
180
|
+
* to have more blocks on the page, just not via the editor.
|
|
181
|
+
*/
|
|
182
|
+
maxInstances?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Get the drag element for the editor.
|
|
185
|
+
*
|
|
186
|
+
* By default, the root element of the component is used for drag actions.
|
|
187
|
+
* Sometimes this might not be desirable however. For example, a button
|
|
188
|
+
* block might render a container as the root element and have the button
|
|
189
|
+
* as the child. In this case the whole container would be clickable and
|
|
190
|
+
* selectable. By providing the button as the drag element, only the button
|
|
191
|
+
* appears to be selectable/draggable.
|
|
192
|
+
*/
|
|
193
|
+
getDraggableElement?: (el: HTMLElement) => Element | undefined | null;
|
|
194
|
+
};
|
|
195
|
+
export type BlockDefinitionRenderForParent = {
|
|
196
|
+
parentBundle: BlockBundleWithNested;
|
|
197
|
+
};
|
|
198
|
+
export type BlockDefinitionRenderForFieldListType = {
|
|
199
|
+
fieldList: ValidFieldListTypes;
|
|
200
|
+
};
|
|
201
|
+
export type BlockDefinitionRenderFor = BlockDefinitionRenderForParent | BlockDefinitionRenderForFieldListType;
|
|
202
|
+
export type BlockDefinitionInput<Options extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, GlobalOptions extends GlobalOptionsKey[] | undefined = undefined> = {
|
|
203
|
+
/**
|
|
204
|
+
* The bundle ID of the block, e.g. "text" or "section_title".
|
|
205
|
+
*/
|
|
206
|
+
bundle: string;
|
|
207
|
+
/**
|
|
208
|
+
* Define the name of a block bundle that supports nested blocks.
|
|
209
|
+
* If a bundle is defined, then this component will be rendered if the
|
|
210
|
+
* parent matches the given bundle.
|
|
211
|
+
*/
|
|
212
|
+
renderFor?: BlockDefinitionRenderFor | BlockDefinitionRenderFor[];
|
|
213
|
+
/**
|
|
214
|
+
* The name of the chunk group.
|
|
215
|
+
*
|
|
216
|
+
* If this value is set, the component will be assigned to this
|
|
217
|
+
* import chunk. Multiple components can have the same chunk name.
|
|
218
|
+
*
|
|
219
|
+
* See the `chunkNames` option on the module's configuration for more details.
|
|
220
|
+
*/
|
|
221
|
+
chunkName?: ValidChunkNames;
|
|
222
|
+
/**
|
|
223
|
+
* Define options available for this block.
|
|
224
|
+
*/
|
|
225
|
+
options?: Options;
|
|
226
|
+
/**
|
|
227
|
+
* Global options to use.
|
|
228
|
+
*
|
|
229
|
+
* These options will be merged with the component-specific options.
|
|
230
|
+
*/
|
|
231
|
+
globalOptions?: GlobalOptions;
|
|
232
|
+
/**
|
|
233
|
+
* Settings for the behaviour in the editor.
|
|
234
|
+
*/
|
|
235
|
+
editor?: BlokkliDefinitionInputEditor<Options, GlobalOptions>;
|
|
236
|
+
};
|
|
237
|
+
export type InjectedBlokkliItem = ComputedRef<{
|
|
238
|
+
index: ComputedRef<number>;
|
|
239
|
+
uuid: string;
|
|
240
|
+
options?: Record<string, string> | undefined;
|
|
241
|
+
isEditing: boolean;
|
|
242
|
+
parentType?: BlockBundleWithNested;
|
|
243
|
+
fieldListType?: ValidFieldListTypes;
|
|
244
|
+
}>;
|
|
245
|
+
export type FieldListItem = {
|
|
246
|
+
uuid: string;
|
|
247
|
+
bundle: string;
|
|
248
|
+
isNew?: boolean;
|
|
249
|
+
options?: Record<string, any>;
|
|
250
|
+
props?: Record<string, any>;
|
|
251
|
+
};
|
|
252
|
+
export type MutatedField = {
|
|
253
|
+
name: string;
|
|
254
|
+
entityType: string;
|
|
255
|
+
entityUuid: string;
|
|
256
|
+
list: FieldListItem[];
|
|
257
|
+
};
|
|
258
|
+
export type FieldConfig = {
|
|
259
|
+
name: string;
|
|
260
|
+
entityType: string;
|
|
261
|
+
entityBundle: string;
|
|
262
|
+
label: string;
|
|
263
|
+
cardinality: number;
|
|
264
|
+
canEdit: boolean;
|
|
265
|
+
allowedBundles: string[];
|
|
266
|
+
};
|
|
267
|
+
export type EditableFieldType = 'plain' | 'markup' | 'table' | 'frame';
|
|
268
|
+
export type EditableFieldConfig = {
|
|
269
|
+
name: string;
|
|
270
|
+
entityType: string;
|
|
271
|
+
entityBundle: string;
|
|
272
|
+
label: string;
|
|
273
|
+
type: EditableFieldType;
|
|
274
|
+
required: boolean;
|
|
275
|
+
maxLength: number;
|
|
276
|
+
};
|
|
277
|
+
export type EntityContext = {
|
|
278
|
+
uuid: string;
|
|
279
|
+
type: string;
|
|
280
|
+
bundle: string;
|
|
281
|
+
};
|
|
282
|
+
export type EditEntity = {
|
|
283
|
+
label?: string;
|
|
284
|
+
status?: boolean;
|
|
285
|
+
bundleLabel?: string;
|
|
286
|
+
};
|
|
287
|
+
export interface Language {
|
|
288
|
+
id: string;
|
|
289
|
+
name: string;
|
|
290
|
+
}
|
|
291
|
+
export interface EntityTranslation {
|
|
292
|
+
id: string;
|
|
293
|
+
url: string;
|
|
294
|
+
editUrl?: string;
|
|
295
|
+
exists: boolean;
|
|
296
|
+
status: boolean;
|
|
297
|
+
}
|
|
298
|
+
export interface TranslationState {
|
|
299
|
+
isTranslatable?: boolean | null;
|
|
300
|
+
sourceLanguage?: string | null;
|
|
301
|
+
availableLanguages?: Language[];
|
|
302
|
+
translations?: EntityTranslation[];
|
|
303
|
+
}
|
|
304
|
+
export interface ConversionItem {
|
|
305
|
+
sourceBundle: string;
|
|
306
|
+
targetBundle: string;
|
|
307
|
+
}
|
|
308
|
+
export interface TransformPlugin {
|
|
309
|
+
/**
|
|
310
|
+
* The ID of the plugin.
|
|
311
|
+
*/
|
|
312
|
+
id: string;
|
|
313
|
+
/**
|
|
314
|
+
* The label of the transform plugin which is shown in the editor.
|
|
315
|
+
*/
|
|
316
|
+
label: string;
|
|
317
|
+
/**
|
|
318
|
+
* The array of bundles for which this transform plugin is available.
|
|
319
|
+
*/
|
|
320
|
+
bundles: string[];
|
|
321
|
+
/**
|
|
322
|
+
* The array of bundles that the transform might create.
|
|
323
|
+
*/
|
|
324
|
+
targetBundles: string[];
|
|
325
|
+
/**
|
|
326
|
+
* The minimum number of items required.
|
|
327
|
+
*/
|
|
328
|
+
min: number;
|
|
329
|
+
/**
|
|
330
|
+
* The maximum number of items.
|
|
331
|
+
*/
|
|
332
|
+
max: number;
|
|
333
|
+
}
|
|
334
|
+
export interface LibraryItem {
|
|
335
|
+
uuid: string;
|
|
336
|
+
label?: string;
|
|
337
|
+
bundle: string;
|
|
338
|
+
item: FieldListItem;
|
|
339
|
+
}
|
|
340
|
+
export interface ImportItem {
|
|
341
|
+
uuid: string;
|
|
342
|
+
label: string;
|
|
343
|
+
}
|
|
344
|
+
export type CommentItem = {
|
|
345
|
+
uuid: string;
|
|
346
|
+
blockUuids: string[];
|
|
347
|
+
resolved: boolean;
|
|
348
|
+
body: string;
|
|
349
|
+
created: string | number;
|
|
350
|
+
user: {
|
|
351
|
+
label: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
export interface MutationItem {
|
|
355
|
+
timestamp?: string;
|
|
356
|
+
pluginId?: string;
|
|
357
|
+
plugin?: {
|
|
358
|
+
label?: string;
|
|
359
|
+
affectedItemUuid?: string;
|
|
360
|
+
};
|
|
361
|
+
enabled?: boolean;
|
|
362
|
+
}
|
|
363
|
+
export interface Validation {
|
|
364
|
+
message: string;
|
|
365
|
+
code?: string;
|
|
366
|
+
propertyPath?: string;
|
|
367
|
+
entityType?: string;
|
|
368
|
+
entityUuid?: string;
|
|
369
|
+
}
|
|
370
|
+
export interface MappedState {
|
|
371
|
+
currentIndex: number;
|
|
372
|
+
mutations: MutationItem[];
|
|
373
|
+
currentUserIsOwner: boolean;
|
|
374
|
+
ownerName: string;
|
|
375
|
+
mutatedState?: {
|
|
376
|
+
mutatedOptions?: any;
|
|
377
|
+
fields?: MutatedField[];
|
|
378
|
+
violations?: Validation[];
|
|
379
|
+
};
|
|
380
|
+
entity: EditEntity;
|
|
381
|
+
mutatedEntity?: any;
|
|
382
|
+
translationState: TranslationState;
|
|
383
|
+
previewUrl?: string;
|
|
384
|
+
}
|
|
385
|
+
export interface BlockBundleDefinition {
|
|
386
|
+
id: string;
|
|
387
|
+
label: string;
|
|
388
|
+
description?: string;
|
|
389
|
+
allowReusable?: boolean;
|
|
390
|
+
isTranslatable?: boolean;
|
|
391
|
+
}
|
|
392
|
+
export type EditMode = 'readonly' | 'editing' | 'translating';
|
|
393
|
+
export type MutatedOptions = {
|
|
394
|
+
[uuid: string]: {
|
|
395
|
+
[key: string]: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Defines a content search item.
|
|
400
|
+
*/
|
|
401
|
+
export type SearchContentItem = {
|
|
402
|
+
/**
|
|
403
|
+
* The ID of the item.
|
|
404
|
+
*/
|
|
405
|
+
id: string;
|
|
406
|
+
/**
|
|
407
|
+
* The entity type of the item.
|
|
408
|
+
*/
|
|
409
|
+
entityType: string;
|
|
410
|
+
/**
|
|
411
|
+
* The entity bundle of the item.
|
|
412
|
+
*/
|
|
413
|
+
entityBundle: string;
|
|
414
|
+
/**
|
|
415
|
+
* The title displayed to the user.
|
|
416
|
+
*/
|
|
417
|
+
title: string;
|
|
418
|
+
/**
|
|
419
|
+
* The possible bundles for which a block may be added using this content item.
|
|
420
|
+
*/
|
|
421
|
+
targetBundles: string[];
|
|
422
|
+
/**
|
|
423
|
+
* Additional context displayed alongside the title.
|
|
424
|
+
*/
|
|
425
|
+
context?: string;
|
|
426
|
+
/**
|
|
427
|
+
* The text displayed to the user.
|
|
428
|
+
*/
|
|
429
|
+
text?: string;
|
|
430
|
+
/**
|
|
431
|
+
* An optional image URL that is used instead of an icon.
|
|
432
|
+
*/
|
|
433
|
+
imageUrl?: string;
|
|
434
|
+
};
|
|
435
|
+
interface ClipboardItemText {
|
|
436
|
+
type: 'text';
|
|
437
|
+
id: string;
|
|
438
|
+
itemBundle: string;
|
|
439
|
+
data: string;
|
|
440
|
+
additional?: string;
|
|
441
|
+
}
|
|
442
|
+
export interface ClipboardItemVideo {
|
|
443
|
+
type: 'video';
|
|
444
|
+
id: string;
|
|
445
|
+
itemBundle: string;
|
|
446
|
+
data: string;
|
|
447
|
+
additional?: string;
|
|
448
|
+
videoService: ReturnType<typeof getVideoId>['service'];
|
|
449
|
+
videoId: string;
|
|
450
|
+
}
|
|
451
|
+
interface ClipboardItemImage {
|
|
452
|
+
type: 'image';
|
|
453
|
+
id: string;
|
|
454
|
+
itemBundle: string;
|
|
455
|
+
data: string;
|
|
456
|
+
additional: string;
|
|
457
|
+
fileName: string;
|
|
458
|
+
fileSize: number;
|
|
459
|
+
fileType: string;
|
|
460
|
+
}
|
|
461
|
+
export interface ClipboardItemFile {
|
|
462
|
+
type: 'file';
|
|
463
|
+
id: string;
|
|
464
|
+
itemBundle: string;
|
|
465
|
+
data: string;
|
|
466
|
+
additional: string;
|
|
467
|
+
fileName: string;
|
|
468
|
+
fileSize: number;
|
|
469
|
+
fileType: string;
|
|
470
|
+
}
|
|
471
|
+
export type ClipboardItem = ClipboardItemText | ClipboardItemVideo | ClipboardItemImage | ClipboardItemFile;
|
|
472
|
+
export interface DraggableHostData {
|
|
473
|
+
type: string;
|
|
474
|
+
uuid: string;
|
|
475
|
+
fieldName: string;
|
|
476
|
+
}
|
|
477
|
+
export type DraggableStyle = {
|
|
478
|
+
/**
|
|
479
|
+
* The border radius for every corner, starting from top left.
|
|
480
|
+
*/
|
|
481
|
+
radius: [number, number, number, number];
|
|
482
|
+
/**
|
|
483
|
+
* The smallest radius of the element.
|
|
484
|
+
*/
|
|
485
|
+
radiusMin: number;
|
|
486
|
+
/**
|
|
487
|
+
* The border radius as a CSS property value.
|
|
488
|
+
*/
|
|
489
|
+
radiusString: string;
|
|
490
|
+
/**
|
|
491
|
+
* The contrast color for highlighting.
|
|
492
|
+
*/
|
|
493
|
+
contrastColor: string;
|
|
494
|
+
/**
|
|
495
|
+
* The translucent contrast color for highlighting.
|
|
496
|
+
*/
|
|
497
|
+
contrastColorTranslucent: string;
|
|
498
|
+
/**
|
|
499
|
+
* The color to make a text (mostly) readable when put on top of the element.
|
|
500
|
+
*/
|
|
501
|
+
textColor: string;
|
|
502
|
+
contrastColorRGB: RGB;
|
|
503
|
+
isInverted: boolean;
|
|
504
|
+
};
|
|
505
|
+
export interface DraggableExistingStructureBlock {
|
|
506
|
+
itemType: 'existing_structure';
|
|
507
|
+
uuid: string;
|
|
508
|
+
itemBundle: string;
|
|
509
|
+
element: () => HTMLElement;
|
|
510
|
+
}
|
|
511
|
+
export interface DraggableExistingBlock {
|
|
512
|
+
itemType: 'existing';
|
|
513
|
+
element: () => HTMLElement;
|
|
514
|
+
entityType: string;
|
|
515
|
+
hostType: string;
|
|
516
|
+
hostBundle: string;
|
|
517
|
+
hostUuid: string;
|
|
518
|
+
hostFieldName: string;
|
|
519
|
+
hostFieldListType: ValidFieldListTypes;
|
|
520
|
+
itemBundle: string;
|
|
521
|
+
isNew: boolean;
|
|
522
|
+
uuid: string;
|
|
523
|
+
isNested: boolean;
|
|
524
|
+
/**
|
|
525
|
+
* The bundle if this item is reusable.
|
|
526
|
+
*/
|
|
527
|
+
reusableBundle?: string;
|
|
528
|
+
/**
|
|
529
|
+
* The reusable UUID if this block is a from_library type.
|
|
530
|
+
*/
|
|
531
|
+
reusableUuid?: string;
|
|
532
|
+
/**
|
|
533
|
+
* The title to use when displaying the block in lists during editing.
|
|
534
|
+
*/
|
|
535
|
+
editTitle?: string;
|
|
536
|
+
parentBlockBundle: BlockBundleWithNested | undefined;
|
|
537
|
+
}
|
|
538
|
+
export interface DraggableNewItem {
|
|
539
|
+
itemType: 'new';
|
|
540
|
+
element: () => HTMLElement;
|
|
541
|
+
itemBundle: string;
|
|
542
|
+
}
|
|
543
|
+
export interface DraggableActionItem {
|
|
544
|
+
itemType: 'action';
|
|
545
|
+
actionType: string;
|
|
546
|
+
itemBundle?: string;
|
|
547
|
+
element: () => HTMLElement;
|
|
548
|
+
}
|
|
549
|
+
export interface DraggableReusableItem {
|
|
550
|
+
itemType: 'reusable';
|
|
551
|
+
element: () => HTMLElement;
|
|
552
|
+
itemBundle: string;
|
|
553
|
+
libraryItemUuid: string;
|
|
554
|
+
}
|
|
555
|
+
export interface DraggableClipboardItem {
|
|
556
|
+
itemType: 'clipboard';
|
|
557
|
+
element: () => HTMLElement;
|
|
558
|
+
itemBundle: string;
|
|
559
|
+
additional?: string;
|
|
560
|
+
clipboardId: string;
|
|
561
|
+
}
|
|
562
|
+
export interface DraggableSearchContentItem {
|
|
563
|
+
itemType: 'search_content';
|
|
564
|
+
element: () => HTMLElement;
|
|
565
|
+
itemBundle: string;
|
|
566
|
+
searchItem: SearchContentItem;
|
|
567
|
+
}
|
|
568
|
+
export interface DraggableMediaLibraryItem {
|
|
569
|
+
itemType: 'media_library';
|
|
570
|
+
element: () => HTMLElement;
|
|
571
|
+
itemBundle: string;
|
|
572
|
+
mediaId: string;
|
|
573
|
+
mediaBundle: string;
|
|
574
|
+
}
|
|
575
|
+
export type DraggableItem = DraggableClipboardItem | DraggableNewItem | DraggableActionItem | DraggableExistingBlock | DraggableExistingStructureBlock | DraggableReusableItem | DraggableSearchContentItem | DraggableMediaLibraryItem;
|
|
576
|
+
/**
|
|
577
|
+
* Defines a droppable entity field.
|
|
578
|
+
*/
|
|
579
|
+
export type DroppableEntityField = {
|
|
580
|
+
/**
|
|
581
|
+
* The droppable field element.
|
|
582
|
+
*/
|
|
583
|
+
element: HTMLElement;
|
|
584
|
+
/**
|
|
585
|
+
* The host.
|
|
586
|
+
*/
|
|
587
|
+
host: DraggableExistingBlock | EntityContext;
|
|
588
|
+
/**
|
|
589
|
+
* The name of the field on which entities can be dropped.
|
|
590
|
+
*/
|
|
591
|
+
fieldName: string;
|
|
592
|
+
};
|
|
593
|
+
export type MoveBlockEvent = {
|
|
594
|
+
afterUuid?: string;
|
|
595
|
+
item: DraggableExistingBlock;
|
|
596
|
+
host: DraggableHostData;
|
|
597
|
+
};
|
|
598
|
+
export type MoveMultipleBlocksEvent = {
|
|
599
|
+
afterUuid?: string;
|
|
600
|
+
uuids: string[];
|
|
601
|
+
host: DraggableHostData;
|
|
602
|
+
};
|
|
603
|
+
export type AddNewBlockEvent = {
|
|
604
|
+
bundle: string;
|
|
605
|
+
host: DraggableHostData;
|
|
606
|
+
afterUuid?: string;
|
|
607
|
+
};
|
|
608
|
+
export type AddClipboardItemEvent = {
|
|
609
|
+
item: ClipboardItem;
|
|
610
|
+
blockBundle: string;
|
|
611
|
+
host: DraggableHostData;
|
|
612
|
+
afterUuid?: string;
|
|
613
|
+
};
|
|
614
|
+
export type AddContentSearchItemEvent = {
|
|
615
|
+
item: SearchContentItem;
|
|
616
|
+
host: DraggableHostData;
|
|
617
|
+
bundle: string;
|
|
618
|
+
afterUuid?: string;
|
|
619
|
+
};
|
|
620
|
+
export type AddReusableItemEvent = {
|
|
621
|
+
libraryItemUuid: string;
|
|
622
|
+
host: DraggableHostData;
|
|
623
|
+
afterUuid?: string;
|
|
624
|
+
};
|
|
625
|
+
export type UpdateBlockOptionEvent = {
|
|
626
|
+
uuid: string;
|
|
627
|
+
key: string;
|
|
628
|
+
value: string;
|
|
629
|
+
};
|
|
630
|
+
export type EditBlockEvent = {
|
|
631
|
+
uuid: string;
|
|
632
|
+
bundle: string;
|
|
633
|
+
};
|
|
634
|
+
export type UpdateMutatedFieldsEvent = {
|
|
635
|
+
fields: MutatedField[];
|
|
636
|
+
};
|
|
637
|
+
type AnimationFrameFieldArea = {
|
|
638
|
+
key: string;
|
|
639
|
+
name: string;
|
|
640
|
+
label: string;
|
|
641
|
+
isNested: boolean;
|
|
642
|
+
rect: DOMRect;
|
|
643
|
+
isVisible: boolean;
|
|
644
|
+
};
|
|
645
|
+
export type AnimationFrameEvent = {
|
|
646
|
+
fieldAreas: AnimationFrameFieldArea[];
|
|
647
|
+
mouseX: number;
|
|
648
|
+
mouseY: number;
|
|
649
|
+
};
|
|
650
|
+
export type Message = {
|
|
651
|
+
type: 'success' | 'error';
|
|
652
|
+
message: string;
|
|
653
|
+
additional?: string | Error | unknown;
|
|
654
|
+
};
|
|
655
|
+
export type Size = {
|
|
656
|
+
width: number;
|
|
657
|
+
height: number;
|
|
658
|
+
};
|
|
659
|
+
export type Coord = {
|
|
660
|
+
x: number;
|
|
661
|
+
y: number;
|
|
662
|
+
};
|
|
663
|
+
export type Rectangle = Size & Coord;
|
|
664
|
+
export type CanvasDrawEvent = {
|
|
665
|
+
mouseX: number;
|
|
666
|
+
mouseY: number;
|
|
667
|
+
artboardOffset: Coord;
|
|
668
|
+
artboardScale: number;
|
|
669
|
+
};
|
|
670
|
+
export type MakeReusableEvent = {
|
|
671
|
+
label: string;
|
|
672
|
+
uuid: string;
|
|
673
|
+
};
|
|
674
|
+
export type DetachReusableBlockEvent = {
|
|
675
|
+
uuids: string[];
|
|
676
|
+
};
|
|
677
|
+
export type KeyPressedEvent = {
|
|
678
|
+
code: string;
|
|
679
|
+
meta: boolean;
|
|
680
|
+
shift: boolean;
|
|
681
|
+
originalEvent: KeyboardEvent;
|
|
682
|
+
};
|
|
683
|
+
export type TranslateBlockEvent = {
|
|
684
|
+
uuid: string;
|
|
685
|
+
language: Language;
|
|
686
|
+
};
|
|
687
|
+
export type ImportFromExistingEvent = {
|
|
688
|
+
sourceUuid: string;
|
|
689
|
+
sourceFields: string[];
|
|
690
|
+
};
|
|
691
|
+
export type ConvertBlockEvent = {
|
|
692
|
+
uuid: string;
|
|
693
|
+
targetBundle: string;
|
|
694
|
+
};
|
|
695
|
+
export type ScrollIntoViewEvent = {
|
|
696
|
+
uuid: string;
|
|
697
|
+
center?: boolean;
|
|
698
|
+
immediate?: boolean;
|
|
699
|
+
};
|
|
700
|
+
export type PluginMountEvent = {
|
|
701
|
+
type: 'ItemDropdown';
|
|
702
|
+
id: string;
|
|
703
|
+
isRendering: ComputedRef<boolean>;
|
|
704
|
+
};
|
|
705
|
+
export type PluginUnmountEvent = {
|
|
706
|
+
type: 'ItemDropdown';
|
|
707
|
+
id: string;
|
|
708
|
+
};
|
|
709
|
+
export type EditableFieldFocusEvent = {
|
|
710
|
+
fieldName: string;
|
|
711
|
+
uuid?: string;
|
|
712
|
+
};
|
|
713
|
+
export type EditableFieldUpdateEvent = {
|
|
714
|
+
name: string;
|
|
715
|
+
entityUuid: string;
|
|
716
|
+
value: string;
|
|
717
|
+
};
|
|
718
|
+
export type BlockAppendEvent = {
|
|
719
|
+
bundle: string;
|
|
720
|
+
host: DraggableHostData;
|
|
721
|
+
afterUuid?: string;
|
|
722
|
+
};
|
|
723
|
+
export type UiResizedEvent = {
|
|
724
|
+
width: number;
|
|
725
|
+
height: number;
|
|
726
|
+
};
|
|
727
|
+
export type AnimateElementMode = 'leave' | 'enter';
|
|
728
|
+
export type AnimatorAddEvent = {
|
|
729
|
+
id: string;
|
|
730
|
+
mode: AnimateElementMode;
|
|
731
|
+
height?: number;
|
|
732
|
+
};
|
|
733
|
+
export type BlokkliFieldElement = {
|
|
734
|
+
key: string;
|
|
735
|
+
name: string;
|
|
736
|
+
label: string;
|
|
737
|
+
isNested: boolean;
|
|
738
|
+
fieldListType: ValidFieldListTypes;
|
|
739
|
+
hostEntityType: string;
|
|
740
|
+
hostEntityBundle: string;
|
|
741
|
+
hostEntityUuid: string;
|
|
742
|
+
allowedBundles: string[];
|
|
743
|
+
allowedFragments: string[];
|
|
744
|
+
cardinality: number;
|
|
745
|
+
element: HTMLElement;
|
|
746
|
+
dropAlignment?: 'vertical' | 'horizontal';
|
|
747
|
+
};
|
|
748
|
+
export type ActionPlacedEvent = {
|
|
749
|
+
action: DraggableActionItem;
|
|
750
|
+
preceedingUuid?: string;
|
|
751
|
+
host: DraggableHostData;
|
|
752
|
+
field: BlokkliFieldElement;
|
|
753
|
+
};
|
|
754
|
+
export type InteractionMode = 'mouse' | 'touch';
|
|
755
|
+
export type DraggableStartEvent = {
|
|
756
|
+
items: DraggableItem[];
|
|
757
|
+
coords: Coord;
|
|
758
|
+
mode: InteractionMode;
|
|
759
|
+
};
|
|
760
|
+
export type GlobalPointerEvent = {
|
|
761
|
+
/**
|
|
762
|
+
* The interaction mode.
|
|
763
|
+
*/
|
|
764
|
+
type: InteractionMode;
|
|
765
|
+
/**
|
|
766
|
+
* The viewport relative x coordinate.
|
|
767
|
+
*/
|
|
768
|
+
x: number;
|
|
769
|
+
/**
|
|
770
|
+
* The viewport relative y coordinate.
|
|
771
|
+
*/
|
|
772
|
+
y: number;
|
|
773
|
+
/**
|
|
774
|
+
* The total distance travelled.
|
|
775
|
+
*/
|
|
776
|
+
distance: number;
|
|
777
|
+
};
|
|
778
|
+
export type GlobalPointerUpEvent = GlobalPointerEvent & {
|
|
779
|
+
/**
|
|
780
|
+
* The total duration in miliseconds from the first click or touch to
|
|
781
|
+
* the last click or touch.
|
|
782
|
+
*/
|
|
783
|
+
duration: number;
|
|
784
|
+
};
|
|
785
|
+
export type SelectStartEvent = {
|
|
786
|
+
uuids: string[];
|
|
787
|
+
mode: InteractionMode;
|
|
788
|
+
};
|
|
789
|
+
export type StructureDragStart = {
|
|
790
|
+
uuid: string;
|
|
791
|
+
bundle: string;
|
|
792
|
+
};
|
|
793
|
+
export type DropTargetEvent = {
|
|
794
|
+
items: DraggableItem[];
|
|
795
|
+
field: BlokkliFieldElement;
|
|
796
|
+
host: DraggableHostData;
|
|
797
|
+
preceedingUuid?: string;
|
|
798
|
+
};
|
|
799
|
+
export type DropClipboardItemEvent = {
|
|
800
|
+
id: string;
|
|
801
|
+
blockBundle: string;
|
|
802
|
+
host: DraggableHostData;
|
|
803
|
+
afterUuid?: string;
|
|
804
|
+
};
|
|
805
|
+
export type EventbusEvents = {
|
|
806
|
+
select: string | string[];
|
|
807
|
+
'item:edit': EditBlockEvent;
|
|
808
|
+
batchTranslate: undefined;
|
|
809
|
+
'dragging:start': DraggableStartEvent;
|
|
810
|
+
'dragging:drop': DropTargetEvent;
|
|
811
|
+
'dragging:end': undefined;
|
|
812
|
+
setActiveFieldKey: string;
|
|
813
|
+
'add:block:new': AddNewBlockEvent;
|
|
814
|
+
updateMutatedFields: UpdateMutatedFieldsEvent;
|
|
815
|
+
animationFrame: AnimationFrameEvent;
|
|
816
|
+
message: Message;
|
|
817
|
+
keyPressed: KeyPressedEvent;
|
|
818
|
+
editEntity: undefined;
|
|
819
|
+
translateEntity: EntityTranslation;
|
|
820
|
+
reloadState: undefined;
|
|
821
|
+
reloadEntity: undefined;
|
|
822
|
+
'select:start': SelectStartEvent;
|
|
823
|
+
'select:toggle': string;
|
|
824
|
+
'select:shiftToggle': string;
|
|
825
|
+
'select:end': string[] | undefined;
|
|
826
|
+
'select:previous': undefined;
|
|
827
|
+
'select:next': undefined;
|
|
828
|
+
'item:dropped': undefined;
|
|
829
|
+
'block:append': BlockAppendEvent;
|
|
830
|
+
scrollIntoView: ScrollIntoViewEvent;
|
|
831
|
+
'animationFrame:before': undefined;
|
|
832
|
+
'canvas:draw': CanvasDrawEvent;
|
|
833
|
+
'state:reloaded': undefined;
|
|
834
|
+
addContentSearchItem: AddContentSearchItemEvent;
|
|
835
|
+
'option:update': UpdateBlockOptionEvent;
|
|
836
|
+
'plugin:mount': PluginMountEvent;
|
|
837
|
+
'plugin:unmount': PluginUnmountEvent;
|
|
838
|
+
'editable:focus': EditableFieldFocusEvent;
|
|
839
|
+
'editable:update': EditableFieldUpdateEvent;
|
|
840
|
+
'editable:save': undefined;
|
|
841
|
+
'droppable:focus': DroppableEntityField;
|
|
842
|
+
'drop:clipboardItem': DropClipboardItemEvent;
|
|
843
|
+
'sidebar:close': undefined;
|
|
844
|
+
'action:placed': ActionPlacedEvent;
|
|
845
|
+
'animator:add': AnimatorAddEvent;
|
|
846
|
+
'ui:resized': undefined;
|
|
847
|
+
'add-list:change': undefined;
|
|
848
|
+
'window:clickAway': undefined;
|
|
849
|
+
'mouse:down': GlobalPointerEvent;
|
|
850
|
+
'mouse:move': GlobalPointerEvent;
|
|
851
|
+
'mouse:up': GlobalPointerUpEvent;
|
|
852
|
+
/**
|
|
853
|
+
* Emitted when publishing failed.
|
|
854
|
+
*/
|
|
855
|
+
'publish:failed': undefined;
|
|
856
|
+
};
|
|
857
|
+
export type Eventbus = Emitter<EventbusEvents>;
|
|
858
|
+
export type ItemEditContext = {
|
|
859
|
+
eventBus: Eventbus;
|
|
860
|
+
mutatedOptions: MutatedOptions;
|
|
861
|
+
dom?: DomProvider;
|
|
862
|
+
};
|
|
863
|
+
export interface BlokkliApp {
|
|
864
|
+
/**
|
|
865
|
+
* The adapter.
|
|
866
|
+
*/
|
|
867
|
+
adapter: BlokkliAdapter<any>;
|
|
868
|
+
eventBus: typeof eventBus;
|
|
869
|
+
runtimeConfig: {
|
|
870
|
+
itemEntityType: string;
|
|
871
|
+
defaultLanguage: string;
|
|
872
|
+
};
|
|
873
|
+
dom: DomProvider;
|
|
874
|
+
storage: StorageProvider;
|
|
875
|
+
types: BlockDefinitionProvider;
|
|
876
|
+
selection: SelectionProvider;
|
|
877
|
+
keyboard: KeyboardProvider;
|
|
878
|
+
ui: UiProvider;
|
|
879
|
+
animation: AnimationProvider;
|
|
880
|
+
state: StateProvider;
|
|
881
|
+
context: ComputedRef<AdapterContext>;
|
|
882
|
+
$t: TextProvider;
|
|
883
|
+
broadcast: BroadcastProvider;
|
|
884
|
+
features: FeaturesProvider;
|
|
885
|
+
theme: ThemeProvider;
|
|
886
|
+
commands: CommandsProvider;
|
|
887
|
+
tour: TourProvider;
|
|
888
|
+
dropAreas: DropAreaProvider;
|
|
889
|
+
debug: DebugProvider;
|
|
890
|
+
}
|
|
891
|
+
export type PasteExistingBlocksEvent = {
|
|
892
|
+
uuids: string[];
|
|
893
|
+
host: DraggableHostData;
|
|
894
|
+
preceedingUuid?: string;
|
|
895
|
+
};
|
|
896
|
+
export type NativeBlokkliEditableBlurEvent = CustomEvent<{
|
|
897
|
+
field: string;
|
|
898
|
+
text: string;
|
|
899
|
+
}>;
|
|
900
|
+
export type UpdateFieldValueEvent = {
|
|
901
|
+
uuid: string;
|
|
902
|
+
fieldName: string;
|
|
903
|
+
fieldValue: string;
|
|
904
|
+
};
|
|
905
|
+
export type AssistantResultMarkup = {
|
|
906
|
+
type: 'markup';
|
|
907
|
+
content: string;
|
|
908
|
+
};
|
|
909
|
+
export type AssistantResult = AssistantResultMarkup;
|
|
910
|
+
export type AddListOrientation = 'horizontal' | 'vertical' | 'sidebar';
|
|
911
|
+
export type AdapterMethods = keyof BlokkliAdapter<any>;
|
|
912
|
+
export type FeatureDefinitionSettingRadiosOption = {
|
|
913
|
+
label: string;
|
|
914
|
+
icon?: BlokkliIcon;
|
|
915
|
+
};
|
|
916
|
+
export type FeatureDefinitionSettingRadios = {
|
|
917
|
+
type: 'radios';
|
|
918
|
+
label: string;
|
|
919
|
+
default: string;
|
|
920
|
+
options: Record<string, FeatureDefinitionSettingRadiosOption>;
|
|
921
|
+
group?: SettingsGroup;
|
|
922
|
+
viewports?: Viewport[];
|
|
923
|
+
};
|
|
924
|
+
export type FeatureDefinitionSettingCheckbox = {
|
|
925
|
+
type: 'checkbox';
|
|
926
|
+
label: string;
|
|
927
|
+
default: boolean;
|
|
928
|
+
group?: SettingsGroup;
|
|
929
|
+
viewports?: Viewport[];
|
|
930
|
+
};
|
|
931
|
+
export type FeatureDefinitionSettingSlider = {
|
|
932
|
+
type: 'slider';
|
|
933
|
+
label: string;
|
|
934
|
+
default: number;
|
|
935
|
+
group?: SettingsGroup;
|
|
936
|
+
viewports?: Viewport[];
|
|
937
|
+
min: number;
|
|
938
|
+
max: number;
|
|
939
|
+
step: number;
|
|
940
|
+
};
|
|
941
|
+
export type FeatureDefinitionSettingMethod = {
|
|
942
|
+
type: 'method';
|
|
943
|
+
label: string;
|
|
944
|
+
method: () => void;
|
|
945
|
+
group?: SettingsGroup;
|
|
946
|
+
viewports?: Viewport[];
|
|
947
|
+
};
|
|
948
|
+
export type FeatureDefinitionSetting = FeatureDefinitionSettingCheckbox | FeatureDefinitionSettingRadios | FeatureDefinitionSettingMethod | FeatureDefinitionSettingSlider;
|
|
949
|
+
export type FeatureDefinition<Methods extends AdapterMethods[] = [], T extends string = ''> = {
|
|
950
|
+
id: T;
|
|
951
|
+
label?: string;
|
|
952
|
+
icon: BlokkliIcon;
|
|
953
|
+
description?: string;
|
|
954
|
+
dependencies?: T[];
|
|
955
|
+
viewports?: Viewport[];
|
|
956
|
+
requiredAdapterMethods?: [...Methods];
|
|
957
|
+
settings?: Record<string, FeatureDefinitionSetting>;
|
|
958
|
+
screenshot?: string;
|
|
959
|
+
};
|
|
960
|
+
export type KeyboardShortcut = {
|
|
961
|
+
group?: string;
|
|
962
|
+
meta?: boolean;
|
|
963
|
+
shift?: boolean;
|
|
964
|
+
code: string;
|
|
965
|
+
label: string;
|
|
966
|
+
};
|
|
967
|
+
export type CommandGroup = 'ui' | 'selection' | 'add' | 'action' | 'misc' | 'options';
|
|
968
|
+
export type Command = {
|
|
969
|
+
id: string;
|
|
970
|
+
label: string;
|
|
971
|
+
group?: CommandGroup;
|
|
972
|
+
icon?: BlokkliIcon;
|
|
973
|
+
bundle?: string;
|
|
974
|
+
disabled?: boolean;
|
|
975
|
+
callback: () => any;
|
|
976
|
+
};
|
|
977
|
+
export type DropArea = {
|
|
978
|
+
id: string;
|
|
979
|
+
label: string;
|
|
980
|
+
icon?: BlokkliIcon;
|
|
981
|
+
element: HTMLElement;
|
|
982
|
+
onDrop: () => Promise<any>;
|
|
983
|
+
};
|
|
984
|
+
export type ContextMenuRule = {
|
|
985
|
+
type: 'rule';
|
|
986
|
+
};
|
|
987
|
+
export type ContextMenuButton = {
|
|
988
|
+
type: 'button';
|
|
989
|
+
label: string;
|
|
990
|
+
icon: BlokkliIcon;
|
|
991
|
+
callback: () => void;
|
|
992
|
+
};
|
|
993
|
+
export type ContextMenu = ContextMenuButton | ContextMenuRule;
|
|
994
|
+
export type FragmentDefinitionInput<Options extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, GlobalOptions extends GlobalOptionsKey[] | undefined = undefined> = {
|
|
995
|
+
/**
|
|
996
|
+
* The unique name of this fragment.
|
|
997
|
+
*/
|
|
998
|
+
name: string;
|
|
999
|
+
/**
|
|
1000
|
+
* The label of the fragment.
|
|
1001
|
+
*/
|
|
1002
|
+
label: string;
|
|
1003
|
+
/**
|
|
1004
|
+
* A short description.
|
|
1005
|
+
*/
|
|
1006
|
+
description?: string;
|
|
1007
|
+
/**
|
|
1008
|
+
* The name of the chunk group.
|
|
1009
|
+
*
|
|
1010
|
+
* If this value is set, the component will be assigned to this
|
|
1011
|
+
* import chunk. Multiple components can have the same chunk name.
|
|
1012
|
+
*
|
|
1013
|
+
* See the `chunkNames` option on the module's configuration for more details.
|
|
1014
|
+
*/
|
|
1015
|
+
chunkName?: ValidChunkNames;
|
|
1016
|
+
/**
|
|
1017
|
+
* Define options available for this block.
|
|
1018
|
+
*/
|
|
1019
|
+
options?: Options;
|
|
1020
|
+
/**
|
|
1021
|
+
* Global options to use.
|
|
1022
|
+
*
|
|
1023
|
+
* These options will be merged with the component-specific options.
|
|
1024
|
+
*/
|
|
1025
|
+
globalOptions?: GlobalOptions;
|
|
1026
|
+
/**
|
|
1027
|
+
* Settings for the behaviour in the editor.
|
|
1028
|
+
*/
|
|
1029
|
+
editor?: BlokkliDefinitionInputEditor<Options, GlobalOptions>;
|
|
1030
|
+
};
|
|
1031
|
+
export type TourItem = {
|
|
1032
|
+
id: string;
|
|
1033
|
+
title: string;
|
|
1034
|
+
text: string;
|
|
1035
|
+
element: HTMLElement | (() => HTMLElement | undefined | null) | undefined | null;
|
|
1036
|
+
};
|
|
1037
|
+
export type DroppableFieldConfig = {
|
|
1038
|
+
name: string;
|
|
1039
|
+
label: string;
|
|
1040
|
+
entityType: string;
|
|
1041
|
+
entityBundle: string;
|
|
1042
|
+
allowedEntityType: string;
|
|
1043
|
+
allowedBundles: string[];
|
|
1044
|
+
cardinality: number;
|
|
1045
|
+
required: boolean;
|
|
1046
|
+
};
|
|
1047
|
+
export type SelectedRect = Rectangle & {
|
|
1048
|
+
uuid: string;
|
|
1049
|
+
style: DraggableStyle;
|
|
1050
|
+
};
|
|
1051
|
+
declare const _default: {};
|
|
1052
|
+
export default _default;
|