@blokkli/editor 2.0.0-alpha.59 → 2.0.0-alpha.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +28 -11
  3. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.d.vue.ts +29 -0
  4. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue +172 -0
  5. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue.d.ts +29 -0
  6. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +19 -0
  7. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.js +80 -0
  8. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +16 -0
  9. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +1 -1
  10. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +12 -9
  11. package/dist/modules/agent/runtime/app/tools/get_page_text/index.d.ts +2 -0
  12. package/dist/modules/agent/runtime/app/tools/get_page_text/index.js +65 -0
  13. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +2 -0
  14. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.js +62 -0
  15. package/dist/modules/agent/runtime/app/tools/helpers.d.ts +8 -2
  16. package/dist/modules/agent/runtime/app/tools/helpers.js +9 -9
  17. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +12 -0
  18. package/dist/modules/agent/runtime/app/tools/schemas.js +20 -0
  19. package/dist/modules/agent/runtime/app/tools/search_media/index.js +1 -1
  20. package/dist/modules/agent/runtime/app/tools/select_media/Component.vue +1 -1
  21. package/dist/modules/agent/runtime/server/agent.js +0 -1
  22. package/dist/modules/agent/runtime/server/classes/Session/index.js +4 -0
  23. package/dist/modules/agent/runtime/shared/toolResult.d.ts +4 -0
  24. package/dist/modules/agent/runtime/shared/toolResult.js +5 -0
  25. package/dist/modules/drupal/graphql/features/notifications.graphql +39 -0
  26. package/dist/modules/drupal/index.mjs +6 -1
  27. package/dist/modules/drupal/runtime/adapter/index.js +38 -0
  28. package/dist/runtime/editor/components/Actions/ItemDropdown/Item.vue +0 -1
  29. package/dist/runtime/editor/components/Actions/ScrollArrow/index.d.vue.ts +13 -0
  30. package/dist/runtime/editor/components/Actions/ScrollArrow/index.vue +52 -0
  31. package/dist/runtime/editor/components/Actions/ScrollArrow/index.vue.d.ts +13 -0
  32. package/dist/runtime/editor/components/Actions/Title/index.vue +2 -2
  33. package/dist/runtime/editor/components/Actions/index.vue +47 -7
  34. package/dist/runtime/editor/components/Actions/useToolbarScroll.d.ts +25 -0
  35. package/dist/runtime/editor/components/Actions/useToolbarScroll.js +125 -0
  36. package/dist/runtime/editor/components/AddListItem/index.vue +0 -2
  37. package/dist/runtime/editor/components/AppMenu/MenuButton.vue +1 -3
  38. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +4 -1
  39. package/dist/runtime/editor/components/Avatar/index.vue +0 -1
  40. package/dist/runtime/editor/components/BlockPreviewRenderer/index.d.vue.ts +1 -1
  41. package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue.d.ts +1 -1
  42. package/dist/runtime/editor/components/BundleSelector/index.vue +0 -4
  43. package/dist/runtime/editor/components/Dialog/index.d.vue.ts +2 -2
  44. package/dist/runtime/editor/components/Dialog/index.vue +1 -3
  45. package/dist/runtime/editor/components/Dialog/index.vue.d.ts +2 -2
  46. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +8 -0
  47. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +12 -2
  48. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +8 -0
  49. package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +8 -0
  50. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +14 -2
  51. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +8 -0
  52. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +2 -2
  53. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +0 -2
  54. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +2 -2
  55. package/dist/runtime/editor/components/DiffApproval/index.vue +1 -0
  56. package/dist/runtime/editor/components/Form/Datepicker/index.vue +0 -1
  57. package/dist/runtime/editor/components/Form/TextDark/index.vue +0 -1
  58. package/dist/runtime/editor/components/Form/Textarea/index.vue +0 -1
  59. package/dist/runtime/editor/components/Form/Toggle/index.d.vue.ts +1 -0
  60. package/dist/runtime/editor/components/Form/Toggle/index.vue +9 -2
  61. package/dist/runtime/editor/components/Form/Toggle/index.vue.d.ts +1 -0
  62. package/dist/runtime/editor/components/FormOverlay/index.vue +0 -1
  63. package/dist/runtime/editor/components/Icon/index.vue +0 -2
  64. package/dist/runtime/editor/components/Messages/Item/index.vue +4 -1
  65. package/dist/runtime/editor/components/Messages/index.vue +3 -0
  66. package/dist/runtime/editor/components/Panel/Sheet/index.vue +1 -1
  67. package/dist/runtime/editor/components/Popup/index.vue +0 -2
  68. package/dist/runtime/editor/components/RichText/Editor/index.d.vue.ts +1 -1
  69. package/dist/runtime/editor/components/RichText/Editor/index.vue.d.ts +1 -1
  70. package/dist/runtime/editor/components/ScheduleDate/index.vue +1 -3
  71. package/dist/runtime/editor/components/SearchOverlay/index.d.vue.ts +1 -1
  72. package/dist/runtime/editor/components/SearchOverlay/index.vue.d.ts +1 -1
  73. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.d.vue.ts +3 -0
  74. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +74 -0
  75. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue.d.ts +3 -0
  76. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.d.vue.ts +7 -0
  77. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.vue +16 -0
  78. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.vue.d.ts +7 -0
  79. package/dist/runtime/editor/components/Toolbar/ViewOptions/index.d.vue.ts +3 -0
  80. package/dist/runtime/editor/components/Toolbar/ViewOptions/index.vue +57 -0
  81. package/dist/runtime/editor/components/Toolbar/ViewOptions/index.vue.d.ts +3 -0
  82. package/dist/runtime/editor/components/Toolbar/index.vue +3 -56
  83. package/dist/runtime/editor/components/ToolbarDropdown/index.d.vue.ts +21 -0
  84. package/dist/runtime/editor/components/ToolbarDropdown/index.vue +36 -0
  85. package/dist/runtime/editor/components/ToolbarDropdown/index.vue.d.ts +21 -0
  86. package/dist/runtime/editor/components/Tooltip/Context.vue +3 -1
  87. package/dist/runtime/editor/components/Tooltip/index.d.vue.ts +1 -1
  88. package/dist/runtime/editor/components/Tooltip/index.vue +4 -1
  89. package/dist/runtime/editor/components/Tooltip/index.vue.d.ts +1 -1
  90. package/dist/runtime/editor/components/index.d.ts +1 -0
  91. package/dist/runtime/editor/components/index.js +1 -0
  92. package/dist/runtime/editor/composables/defineViewOption.d.ts +5 -0
  93. package/dist/runtime/editor/composables/defineViewOption.js +10 -0
  94. package/dist/runtime/editor/composables/index.d.ts +3 -0
  95. package/dist/runtime/editor/composables/index.js +2 -0
  96. package/dist/runtime/editor/composables/useDismiss.d.ts +30 -0
  97. package/dist/runtime/editor/composables/useDismiss.js +43 -0
  98. package/dist/runtime/editor/composables/useGlobalBlokkliObject.d.ts +3 -3
  99. package/dist/runtime/editor/css/output.css +1 -1
  100. package/dist/runtime/editor/events/index.d.ts +23 -0
  101. package/dist/runtime/editor/features/add-list/Actions/index.vue +0 -1
  102. package/dist/runtime/editor/features/add-list/Blocks/index.vue +0 -1
  103. package/dist/runtime/editor/features/add-list/Help/Item.vue +2 -7
  104. package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
  105. package/dist/runtime/editor/features/add-list/index.vue +0 -2
  106. package/dist/runtime/editor/features/anchors/index.vue +11 -11
  107. package/dist/runtime/editor/features/anchors/types.d.ts +1 -0
  108. package/dist/runtime/editor/features/anchors/types.js +1 -0
  109. package/dist/runtime/editor/features/artboard/Renderer.vue +30 -28
  110. package/dist/runtime/editor/features/block-scheduler/Dialog/ScheduleSection.vue +0 -3
  111. package/dist/runtime/editor/features/block-scheduler/index.vue +0 -1
  112. package/dist/runtime/editor/features/block-transfer/SummaryDialog/index.vue +0 -4
  113. package/dist/runtime/editor/features/breadcrumbs/Crumb/index.vue +0 -5
  114. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  115. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -3
  116. package/dist/runtime/editor/features/command-palette/Palette/index.vue +0 -1
  117. package/dist/runtime/editor/features/comments/AddForm/index.vue +0 -1
  118. package/dist/runtime/editor/features/comments/Comment/Actions/index.vue +0 -4
  119. package/dist/runtime/editor/features/comments/Comment/index.d.vue.ts +14 -0
  120. package/dist/runtime/editor/features/comments/Comment/index.vue +29 -8
  121. package/dist/runtime/editor/features/comments/Comment/index.vue.d.ts +14 -0
  122. package/dist/runtime/editor/features/comments/CommentInput/index.d.vue.ts +1 -1
  123. package/dist/runtime/editor/features/comments/CommentInput/index.vue +0 -3
  124. package/dist/runtime/editor/features/comments/CommentInput/index.vue.d.ts +1 -1
  125. package/dist/runtime/editor/features/comments/Sidebar/AddForm/index.vue +0 -1
  126. package/dist/runtime/editor/features/comments/Sidebar/index.d.vue.ts +16 -0
  127. package/dist/runtime/editor/features/comments/Sidebar/index.vue +13 -8
  128. package/dist/runtime/editor/features/comments/Sidebar/index.vue.d.ts +16 -0
  129. package/dist/runtime/editor/features/comments/Thread/ReplyForm/index.vue +0 -1
  130. package/dist/runtime/editor/features/comments/Thread/index.d.vue.ts +16 -0
  131. package/dist/runtime/editor/features/comments/Thread/index.vue +26 -6
  132. package/dist/runtime/editor/features/comments/Thread/index.vue.d.ts +16 -0
  133. package/dist/runtime/editor/features/comments/index.vue +28 -3
  134. package/dist/runtime/editor/features/delete/types.d.ts +1 -0
  135. package/dist/runtime/editor/features/delete/types.js +1 -0
  136. package/dist/runtime/editor/features/dev-mode/index.vue +17 -15
  137. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -0
  138. package/dist/runtime/editor/features/duplicate/types.d.ts +1 -0
  139. package/dist/runtime/editor/features/duplicate/types.js +1 -0
  140. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +0 -2
  141. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +0 -1
  142. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +0 -5
  143. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +0 -5
  144. package/dist/runtime/editor/features/editable-mask/index.vue +21 -20
  145. package/dist/runtime/editor/features/entity-title/index.vue +0 -4
  146. package/dist/runtime/editor/features/fragments/Dialog/index.vue +0 -4
  147. package/dist/runtime/editor/features/grid/index.vue +16 -15
  148. package/dist/runtime/editor/features/grid/types.d.ts +1 -0
  149. package/dist/runtime/editor/features/grid/types.js +1 -0
  150. package/dist/runtime/editor/features/help/Dialog/index.d.vue.ts +7 -0
  151. package/dist/runtime/editor/features/help/Dialog/index.vue +57 -0
  152. package/dist/runtime/editor/features/help/Dialog/index.vue.d.ts +7 -0
  153. package/dist/runtime/editor/features/help/index.vue +52 -47
  154. package/dist/runtime/editor/features/history/List/index.vue +2 -9
  155. package/dist/runtime/editor/features/history/types.d.ts +1 -0
  156. package/dist/runtime/editor/features/history/types.js +1 -0
  157. package/dist/runtime/editor/features/notifications/Item/index.d.vue.ts +4 -0
  158. package/dist/runtime/editor/features/notifications/Item/index.vue +96 -0
  159. package/dist/runtime/editor/features/notifications/Item/index.vue.d.ts +4 -0
  160. package/dist/runtime/editor/features/notifications/List/index.d.vue.ts +11 -0
  161. package/dist/runtime/editor/features/notifications/List/index.vue +126 -0
  162. package/dist/runtime/editor/features/notifications/List/index.vue.d.ts +11 -0
  163. package/dist/runtime/editor/features/notifications/docs.md +12 -0
  164. package/dist/runtime/editor/features/notifications/index.d.vue.ts +3 -0
  165. package/dist/runtime/editor/features/notifications/index.vue +123 -0
  166. package/dist/runtime/editor/features/notifications/index.vue.d.ts +3 -0
  167. package/dist/runtime/editor/features/notifications/types.d.ts +132 -0
  168. package/dist/runtime/editor/features/notifications/types.js +20 -0
  169. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +6 -2
  170. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +14 -4
  171. package/dist/runtime/editor/features/options/Form/Color/index.vue +1 -1
  172. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +0 -1
  173. package/dist/runtime/editor/features/options/Form/DateTimeLocal/index.vue +0 -1
  174. package/dist/runtime/editor/features/options/Form/Group.vue +3 -1
  175. package/dist/runtime/editor/features/options/Form/Item.vue +1 -2
  176. package/dist/runtime/editor/features/options/Form/Number/index.vue +9 -3
  177. package/dist/runtime/editor/features/options/Form/Radios/index.vue +3 -2
  178. package/dist/runtime/editor/features/options/Form/Range/index.vue +8 -2
  179. package/dist/runtime/editor/features/options/Form/Text/index.vue +6 -2
  180. package/dist/runtime/editor/features/options/index.vue +7 -1
  181. package/dist/runtime/editor/features/ownership/Banner/index.vue +3 -1
  182. package/dist/runtime/editor/features/ownership/types.d.ts +1 -0
  183. package/dist/runtime/editor/features/ownership/types.js +1 -0
  184. package/dist/runtime/editor/features/preview-grant/types.d.ts +1 -0
  185. package/dist/runtime/editor/features/preview-grant/types.js +1 -0
  186. package/dist/runtime/editor/features/proxy-view/index.vue +24 -21
  187. package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +0 -2
  188. package/dist/runtime/editor/features/publish/Dialog/index.vue +1 -2
  189. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +0 -1
  190. package/dist/runtime/editor/features/revert/types.d.ts +1 -0
  191. package/dist/runtime/editor/features/revert/types.js +1 -0
  192. package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +18 -8
  193. package/dist/runtime/editor/features/swap/types.d.ts +1 -0
  194. package/dist/runtime/editor/features/swap/types.js +1 -0
  195. package/dist/runtime/editor/features/translations/Banner/index.vue +4 -1
  196. package/dist/runtime/editor/features/translations/CsvDialog/Import/index.vue +4 -1
  197. package/dist/runtime/editor/features/translations/TranslateDialog/index.vue +7 -2
  198. package/dist/runtime/editor/plugins/BlockIndicator/index.vue +0 -2
  199. package/dist/runtime/editor/plugins/ContextMenu/Menu/index.vue +4 -36
  200. package/dist/runtime/editor/plugins/ItemAction/index.vue +0 -1
  201. package/dist/runtime/editor/plugins/Sidebar/index.vue +7 -50
  202. package/dist/runtime/editor/plugins/ToolbarButton/index.d.vue.ts +8 -2
  203. package/dist/runtime/editor/plugins/ToolbarButton/index.vue +122 -28
  204. package/dist/runtime/editor/plugins/ToolbarButton/index.vue.d.ts +8 -2
  205. package/dist/runtime/editor/plugins/index.d.ts +1 -2
  206. package/dist/runtime/editor/plugins/index.js +1 -3
  207. package/dist/runtime/editor/providers/fieldValue.js +11 -13
  208. package/dist/runtime/editor/providers/plugin.d.ts +12 -0
  209. package/dist/runtime/editor/providers/plugin.js +9 -0
  210. package/dist/runtime/editor/translations/de.json +51 -19
  211. package/dist/runtime/editor/translations/fr.json +16 -4
  212. package/dist/runtime/editor/translations/gsw_CH.json +44 -19
  213. package/dist/runtime/editor/translations/it.json +16 -4
  214. package/package.json +4 -5
  215. package/dist/runtime/editor/plugins/ViewOption/index.d.vue.ts +0 -139
  216. package/dist/runtime/editor/plugins/ViewOption/index.vue +0 -99
  217. package/dist/runtime/editor/plugins/ViewOption/index.vue.d.ts +0 -139
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <DialogModal
3
+ id="help"
4
+ :title="$t('featureHelpTitle', 'Help')"
5
+ hide-buttons
6
+ icon="bk_mdi_help"
7
+ mono
8
+ @cancel="$emit('cancel')"
9
+ >
10
+ <div class="bk bk-help">
11
+ <div v-if="isTourEnabled" class="bk-help-section">
12
+ <button
13
+ class="bk-button bk-scheme-yellow bk-is-fullwidth"
14
+ :disabled="tour.isTouring.value"
15
+ @click="onStartTour"
16
+ >
17
+ {{ $t("tourLabel", "Take a tour") }}
18
+ </button>
19
+ </div>
20
+ <div class="bk-help-section">
21
+ <h3>{{ $t("featureHelpShortcuts", "Shortcuts") }}</h3>
22
+ <Shortcuts />
23
+ </div>
24
+ </div>
25
+ </DialogModal>
26
+ </template>
27
+
28
+ <script setup>
29
+ import { useBlokkli, computed, defineAsyncComponent } from "#imports";
30
+ import { DialogModal } from "#blokkli/editor/components";
31
+ const Shortcuts = defineAsyncComponent(() => import("../Shortcuts/index.vue"));
32
+ const { $t, features, tour } = useBlokkli();
33
+ const emit = defineEmits(["cancel"]);
34
+ const isTourEnabled = computed(
35
+ () => features.mountedFeatures.value.find((v) => v.id === "tour")
36
+ );
37
+ function onStartTour() {
38
+ tour.isTouring.value = true;
39
+ emit("cancel");
40
+ }
41
+ </script>
42
+
43
+ <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
44
+ .bk.bk-help {
45
+ padding: 20px;
46
+ container-type: inline-size;
47
+ }
48
+ :is(.bk.bk-help .bk-help-section):not(:last-child) {
49
+ margin-bottom: 20px;
50
+ }
51
+ :is(.bk.bk-help .bk-help-section) > h3 {
52
+ font-size: var(--text-lg, 18px);
53
+ line-height: var(--bk-tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));
54
+ --bk-tw-font-weight: var(--font-weight-bold, 700);
55
+ font-weight: var(--font-weight-bold, 700);
56
+ }
57
+ </style>
@@ -0,0 +1,7 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ cancel: () => any;
3
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
4
+ onCancel?: (() => any) | undefined;
5
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -1,28 +1,9 @@
1
1
  <template>
2
- <PluginSidebar
3
- id="help"
4
- :title="$t('featureHelpTitle', 'Help')"
5
- :tour-text="$t('helpTourText', 'Shows a list of available shortcuts.')"
6
- icon="bk_mdi_help"
7
- weight="100"
8
- key-code="F1"
9
- >
10
- <div class="bk bk-help">
11
- <div v-if="isTourEnabled" class="bk-help-section">
12
- <button
13
- class="bk-button bk-scheme-yellow bk-is-fullwidth"
14
- :disabled="tour.isTouring.value"
15
- @click="tour.isTouring.value = true"
16
- >
17
- {{ $t("tourLabel", "Take a tour") }}
18
- </button>
19
- </div>
20
- <div class="bk-help-section">
21
- <h3>{{ $t("featureHelpShortcuts", "Shortcuts") }}</h3>
22
- <Shortcuts />
23
- </div>
24
- </div>
25
- </PluginSidebar>
2
+ <Teleport :to="ui.mainLayoutElement.value">
3
+ <BlokkliTransition name="slide-up">
4
+ <HelpDialog v-if="showDialog" @cancel="onClose" />
5
+ </BlokkliTransition>
6
+ </Teleport>
26
7
  </template>
27
8
 
28
9
  <script setup>
@@ -32,19 +13,59 @@ import {
32
13
  computed,
33
14
  defineAsyncComponent
34
15
  } from "#imports";
35
- import { PluginSidebar } from "#blokkli/editor/plugins";
36
- const Shortcuts = defineAsyncComponent(() => import("./Shortcuts/index.vue"));
16
+ import { BlokkliTransition } from "#blokkli/editor/components";
17
+ import {
18
+ defineMenuButton,
19
+ defineShortcut,
20
+ onBlokkliEvent
21
+ } from "#blokkli/editor/composables";
22
+ const HelpDialog = defineAsyncComponent(() => import("./Dialog/index.vue"));
37
23
  defineBlokkliFeature({
38
24
  id: "help",
39
25
  icon: "bk_mdi_help",
40
26
  label: "Help",
41
- description: "Provides a sidebar pane with helpful information on how to use blokkli.",
27
+ description: "Provides a menu button to display a dialog with shortcuts and a link to the editor tour.",
42
28
  viewports: ["desktop"]
43
29
  });
44
- const { $t, features, tour } = useBlokkli();
45
- const isTourEnabled = computed(
46
- () => features.mountedFeatures.value.find((v) => v.id === "tour")
47
- );
30
+ const { $t, ui } = useBlokkli();
31
+ const showDialog = computed(() => ui.currentDialog.value?.id === "help");
32
+ function onOpen() {
33
+ ui.openDialog({ id: "help", alignment: "center" });
34
+ }
35
+ function onClose() {
36
+ ui.closeDialog("help");
37
+ }
38
+ defineMenuButton(() => {
39
+ return {
40
+ id: "help",
41
+ title: $t("featureHelpTitle", "Help"),
42
+ description: $t("helpMenuDescription", "View available keyboard shortcuts"),
43
+ icon: "bk_mdi_help",
44
+ secondary: true,
45
+ callback: onOpen
46
+ };
47
+ });
48
+ defineShortcut({
49
+ code: "F1",
50
+ label: $t("featureHelpTitle", "Help")
51
+ });
52
+ onBlokkliEvent("keyPressed", (e) => {
53
+ if (e.code !== "F1") {
54
+ return;
55
+ }
56
+ if (ui.hasNestedEditorOpen.value) {
57
+ return;
58
+ }
59
+ if (ui.hasDialogOpen.value && !showDialog.value) {
60
+ return;
61
+ }
62
+ e.originalEvent.preventDefault();
63
+ if (showDialog.value) {
64
+ onClose();
65
+ } else {
66
+ onOpen();
67
+ }
68
+ });
48
69
  </script>
49
70
 
50
71
  <script>
@@ -52,19 +73,3 @@ export default {
52
73
  name: "Help"
53
74
  };
54
75
  </script>
55
-
56
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
57
- .bk.bk-help {
58
- padding: 20px;
59
- container-type: inline-size;
60
- }
61
- :is(.bk.bk-help .bk-help-section):not(:last-child) {
62
- margin-bottom: 20px;
63
- }
64
- :is(.bk.bk-help .bk-help-section) > h3 {
65
- font-size: var(--text-lg, 18px);
66
- line-height: var(--bk-tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));
67
- --bk-tw-font-weight: var(--font-weight-bold, 700);
68
- font-weight: var(--font-weight-bold, 700);
69
- }
70
- </style>
@@ -1,12 +1,9 @@
1
1
  <template>
2
- <div class="bk bk-history bk-control" data-test="history-list">
2
+ <div class="bk bk-history bk-control">
3
3
  <ul v-if="mapped.length">
4
4
  <li
5
5
  v-for="item in mapped"
6
6
  :key="item.index"
7
- data-test="history-item"
8
- :data-test-history-index="item.index"
9
- :data-test-history-active="item.index === currentMutationIndex"
10
7
  :class="{
11
8
  'bk-is-not-active': item.index > currentMutationIndex,
12
9
  'bk-is-active': item.index === currentMutationIndex,
@@ -17,7 +14,6 @@
17
14
  <button
18
15
  :disabled="!canEdit"
19
16
  class="bk-history-item-button"
20
- data-test="history-item-button"
21
17
  @click="setHistoryIndex(item.index)"
22
18
  >
23
19
  <div>
@@ -55,8 +51,6 @@
55
51
  </li>
56
52
  <li
57
53
  class="bk-is-last"
58
- data-test="history-current-revision"
59
- :data-test-history-active="currentMutationIndex === -1"
60
54
  :class="[
61
55
  currentMutationIndex === -1 ? 'bk-is-active' : 'bk-is-applied',
62
56
  { 'bk-has-shadow': !scrolledToEnd }
@@ -64,7 +58,6 @@
64
58
  >
65
59
  <button
66
60
  class="bk-history-item-button"
67
- data-test="history-item-button"
68
61
  @click="setHistoryIndex(-1)"
69
62
  >
70
63
  <div>
@@ -83,7 +76,7 @@
83
76
  </button>
84
77
  </li>
85
78
  </ul>
86
- <div v-else class="bk-history-empty-message" data-test="history-empty">
79
+ <div v-else class="bk-history-empty-message">
87
80
  {{ $t("historyEmpty", "There are now changes yet.") }}
88
81
  </div>
89
82
  </div>
@@ -10,3 +10,4 @@ declare module '#blokkli/editor/adapter' {
10
10
  setMutationItemStatus?: (index: number, status: boolean) => Promise<MutationResponseLike<T>>;
11
11
  }
12
12
  }
13
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { BlokkliNotification } from '../types.js';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: import("vue").DefineComponent<BlokkliNotification, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlokkliNotification> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <li class="_bk_border-b _bk_border-b-mono-300">
3
+ <component
4
+ :is="href ? 'a' : 'div'"
5
+ :href="href || void 0"
6
+ :target="href ? '_blank' : void 0"
7
+ :rel="href ? 'noopener' : void 0"
8
+ class="bk-notification-item _bk_px-10 _bk_py-15 _bk_hover:border-mono-300 _bk_flex _bk_gap-8 _bk_group"
9
+ :class="{
10
+ '_bk_hover:bg-mono-100': href
11
+ }"
12
+ >
13
+ <div
14
+ class="_bk_shrink-0 _bk_size-25 _bk_rounded-full _bk_flex _bk_items-center _bk_justify-center"
15
+ :class="{
16
+ '_bk_bg-mono-200 _bk_text-mono-500': read,
17
+ '_bk_text-yellow-dark! _bk_bg-yellow-normal': !read
18
+ }"
19
+ >
20
+ <Icon :name="icon" class="_bk_size-15" />
21
+ </div>
22
+
23
+ <div class="_bk_min-w-0 _bk_flex-1">
24
+ <div class="_bk_text-sm _bk_text-mono-900 _bk_font-semibold _bk_leading-tight">
25
+ {{ title }}
26
+ </div>
27
+ <div class="_bk_text-xs _bk_text-mono-600 _bk_flex _bk_items-center _bk_gap-5 _bk_min-w-0 _bk_mt-3">
28
+ <div class="_bk_shrink-0 _bk_font-semibold">
29
+ <RelativeTime :timestamp="created" />
30
+ </div>
31
+ <template v-if="host">
32
+ <span class="_bk_truncate">{{ host.label }}</span>
33
+ </template>
34
+ </div>
35
+ <div v-if="message" class="_bk_text-sm _bk_mt-10">
36
+ {{ message }}
37
+ </div>
38
+ </div>
39
+ </component>
40
+ </li>
41
+ </template>
42
+
43
+ <script setup>
44
+ import { computed } from "#imports";
45
+ import { Icon, RelativeTime } from "#blokkli/editor/components";
46
+ const props = defineProps({
47
+ uuid: { type: String, required: true },
48
+ read: { type: Boolean, required: true },
49
+ created: { type: String, required: true },
50
+ type: { type: null, required: true },
51
+ title: { type: String, required: true },
52
+ message: { type: String, required: false },
53
+ user: { type: [Object, null], required: false },
54
+ relatedEntityUuid: { type: String, required: false },
55
+ host: { type: [Object, null], required: true }
56
+ });
57
+ const ICONS = {
58
+ "comment:mention": "bk_mdi_alternate_email",
59
+ "comment:resolved": "bk_mdi_check_circle",
60
+ "comment:reply": "bk_mdi_chat",
61
+ "comment:thread": "bk_mdi_chat",
62
+ "edit-state:approved": "bk_mdi_verified",
63
+ generic: "bk_mdi_notifications"
64
+ };
65
+ const icon = computed(() => ICONS[props.type]);
66
+ function extraQuery() {
67
+ if (!props.relatedEntityUuid) {
68
+ return {};
69
+ }
70
+ switch (props.type) {
71
+ case "comment:mention":
72
+ case "comment:reply":
73
+ case "comment:resolved":
74
+ case "comment:thread":
75
+ return { blokkliComment: props.relatedEntityUuid };
76
+ }
77
+ return {};
78
+ }
79
+ const href = computed(() => {
80
+ if (!props.host) {
81
+ return null;
82
+ }
83
+ const url = new URL(props.host.url, window.location.origin);
84
+ url.searchParams.set("blokkliEditing", props.host.uuid);
85
+ for (const [key, value] of Object.entries(extraQuery())) {
86
+ url.searchParams.set(key, value);
87
+ }
88
+ return url.origin === window.location.origin ? url.pathname + url.search + url.hash : url.toString();
89
+ });
90
+ </script>
91
+
92
+ <script>
93
+ export default {
94
+ name: "NotificationItem"
95
+ };
96
+ </script>
@@ -0,0 +1,4 @@
1
+ import type { BlokkliNotification } from '../types.js';
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
4
+ declare const __VLS_export: import("vue").DefineComponent<BlokkliNotification, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlokkliNotification> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,11 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{
4
+ unreadCount: number | null;
5
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:unreadCount": (value: number | null) => any;
7
+ }, string, import("vue").PublicProps, Readonly<{
8
+ unreadCount: number | null;
9
+ }> & Readonly<{
10
+ "onUpdate:unreadCount"?: ((value: number | null) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <ScrollBoundary
3
+ class="_bk_w-[400px] _bk_overflow-auto bk-scrollbar-light _bk_max-h-[600px]"
4
+ >
5
+ <TransitionHeight>
6
+ <div
7
+ v-if="unreadCount"
8
+ class="_bk_flex _bk_items-center _bk_justify-end _bk_px-15 _bk_py-10 _bk_border-b _bk_border-b-mono-300"
9
+ >
10
+ <button
11
+ class="bk-notifications-mark-all _bk_flex _bk_items-center _bk_gap-5 _bk_text-sm _bk_text-mono-700 _bk_hover:text-accent-700"
12
+ @click.stop="onMarkAllRead"
13
+ >
14
+ <Icon name="bk_mdi_done_all" class="_bk_size-15" />
15
+ <span>{{ $t("notificationsMarkAllRead", "Mark all as read") }}</span>
16
+ </button>
17
+ </div>
18
+ </TransitionHeight>
19
+
20
+ <ul v-if="notifications.length" class="_bk_select-text">
21
+ <NotificationItem
22
+ v-for="notification in notifications"
23
+ :key="notification.uuid"
24
+ v-bind="notification"
25
+ />
26
+ </ul>
27
+ <div
28
+ v-else
29
+ class="_bk_flex-1 _bk_flex _bk_items-center _bk_justify-center _bk_p-30 _bk_text-center _bk_text-sm _bk_text-mono-500"
30
+ >
31
+ {{ $t("notificationsEmpty", "No notifications.") }}
32
+ </div>
33
+
34
+ <div
35
+ v-if="hasMore"
36
+ class="_bk_sticky _bk_bottom-0 _bk_z-50 _bk_bg-linear-0 _bk_from-white _bk_to-white/0 _bk_via-65% _bk_via-white"
37
+ >
38
+ <button
39
+ class="_bk_w-full _bk_py-15 _bk_text-sm _bk_text-mono-700 _bk_hover:text-accent-700 _bk_disabled:opacity-40 _bk_disabled:cursor-default _bk_text-center _bk_font-semibold"
40
+ :disabled="isLoadingMore"
41
+ @click.stop="onLoadMore"
42
+ >
43
+ {{ $t("notificationsLoadMore", "Load more") }}
44
+ </button>
45
+ </div>
46
+ </ScrollBoundary>
47
+ </template>
48
+
49
+ <script setup>
50
+ import { computed, ref, useBlokkli } from "#imports";
51
+ import {
52
+ Icon,
53
+ ScrollBoundary,
54
+ TransitionHeight
55
+ } from "#blokkli/editor/components";
56
+ import { emitMessage } from "#blokkli/editor/events";
57
+ import NotificationItem from "../Item/index.vue";
58
+ const { $t, adapter } = useBlokkli();
59
+ const unreadCount = defineModel("unreadCount", { type: [Number, null], ...{
60
+ required: true
61
+ } });
62
+ const notifications = ref([]);
63
+ const nextCursor = ref(null);
64
+ const isLoadingMore = ref(false);
65
+ const hasMore = computed(() => nextCursor.value !== null);
66
+ const reportError = (additional) => emitMessage(
67
+ $t("notificationsLoadError", "Failed to load notifications."),
68
+ "error",
69
+ additional
70
+ );
71
+ try {
72
+ const initial = await adapter.loadNotifications({ markAsRead: true });
73
+ notifications.value = initial.items;
74
+ nextCursor.value = initial.nextCursor;
75
+ unreadCount.value = initial.unreadCount;
76
+ } catch (err) {
77
+ reportError(err);
78
+ }
79
+ const onLoadMore = async () => {
80
+ if (isLoadingMore.value || !hasMore.value) {
81
+ return;
82
+ }
83
+ isLoadingMore.value = true;
84
+ try {
85
+ const next = await adapter.loadNotifications({
86
+ after: nextCursor.value ?? void 0,
87
+ markAsRead: true
88
+ });
89
+ const seen = new Set(notifications.value.map((n) => n.uuid));
90
+ notifications.value = [
91
+ ...notifications.value,
92
+ ...next.items.filter((n) => !seen.has(n.uuid))
93
+ ];
94
+ nextCursor.value = next.nextCursor;
95
+ unreadCount.value = next.unreadCount;
96
+ } catch (err) {
97
+ reportError(err);
98
+ } finally {
99
+ isLoadingMore.value = false;
100
+ }
101
+ };
102
+ const onMarkAllRead = async () => {
103
+ try {
104
+ unreadCount.value = await adapter.markAllNotificationsAsRead();
105
+ notifications.value = notifications.value.map((n) => ({
106
+ ...n,
107
+ read: true
108
+ }));
109
+ } catch (err) {
110
+ emitMessage(
111
+ $t(
112
+ "notificationsMarkAllReadError",
113
+ "Failed to mark notifications as read."
114
+ ),
115
+ "error",
116
+ err
117
+ );
118
+ }
119
+ };
120
+ </script>
121
+
122
+ <script>
123
+ export default {
124
+ name: "NotificationsList"
125
+ };
126
+ </script>
@@ -0,0 +1,11 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{
4
+ unreadCount: number | null;
5
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:unreadCount": (value: number | null) => any;
7
+ }, string, import("vue").PublicProps, Readonly<{
8
+ unreadCount: number | null;
9
+ }> & Readonly<{
10
+ "onUpdate:unreadCount"?: ((value: number | null) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,12 @@
1
+ ## Sidebar
2
+
3
+ The sidebar pane lists the current user's notifications (mentions, resolved
4
+ comments, edit state events). The toolbar tab shows a badge with the number of
5
+ unread notifications.
6
+
7
+ ## Deep linking
8
+
9
+ Each notification links to its host entity in edit mode. The feature builds the
10
+ URL from the host entity URL plus `?blokkliEditing=<uuid>` and any type-specific
11
+ query parameter (e.g. `blokkliComment=<uuid>` for comment notifications). Links
12
+ open in a new tab.
@@ -0,0 +1,3 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,123 @@
1
+ <template>
2
+ <PluginToolbarButton
3
+ id="notifications"
4
+ ref="toolbarButton"
5
+ :title="$t('notifications', 'Notifications')"
6
+ :tour-text="
7
+ $t(
8
+ 'notificationsTourText',
9
+ 'Shows notifications about mentions, resolved comments and other events.'
10
+ )
11
+ "
12
+ :active="isVisible"
13
+ :disabled="unreadCount === null"
14
+ :weight="-100"
15
+ region="before-sidebar"
16
+ icon="bk_mdi_notifications"
17
+ class="_bk_border-r _bk_border-r-mono-600 bk-has-dropdown-bottom"
18
+ @click="isVisible = !isVisible"
19
+ >
20
+ <template #after>
21
+ <BlokkliTransition name="context-menu">
22
+ <ToolbarDropdown
23
+ v-if="isVisible"
24
+ :toggle-element
25
+ class="_bk_origin-top-right"
26
+ :title="$t('notifications', 'Notifications')"
27
+ @close="isVisible = false"
28
+ >
29
+ <NotificationsList v-model:unread-count="unreadCount" />
30
+ </ToolbarDropdown>
31
+ </BlokkliTransition>
32
+ </template>
33
+ <template #icon-addon>
34
+ <div
35
+ v-if="unreadCount"
36
+ class="bk-sidebar-badge bk-is-yellow"
37
+ >
38
+ {{ unreadCount }}
39
+ </div>
40
+ </template>
41
+ </PluginToolbarButton>
42
+ </template>
43
+
44
+ <script setup>
45
+ import {
46
+ ref,
47
+ computed,
48
+ useBlokkli,
49
+ defineBlokkliFeature,
50
+ useTemplateRef,
51
+ onMounted,
52
+ onUnmounted
53
+ } from "#imports";
54
+ import { PluginToolbarButton } from "#blokkli/editor/plugins";
55
+ import { ToolbarDropdown, BlokkliTransition } from "#blokkli/editor/components";
56
+ import NotificationsList from "./List/index.vue";
57
+ const { adapter } = defineBlokkliFeature({
58
+ id: "notifications",
59
+ icon: "bk_mdi_notifications",
60
+ label: "Notifications",
61
+ requiredAdapterMethods: [
62
+ "loadNotifications",
63
+ "loadUnreadNotificationsCount",
64
+ "markAllNotificationsAsRead"
65
+ ],
66
+ description: "Shows notifications for the current user (mentions, resolved comments, edit state events)."
67
+ });
68
+ const { $t, ui } = useBlokkli();
69
+ const ID = "notifications";
70
+ const isVisible = computed({
71
+ get() {
72
+ return ui.openContextMenu.value === ID;
73
+ },
74
+ set(isOpen) {
75
+ if (isOpen) {
76
+ ui.openContextMenu.value = ID;
77
+ } else {
78
+ ui.openContextMenu.value = "";
79
+ }
80
+ }
81
+ });
82
+ const toolbarButton = useTemplateRef("toolbarButton");
83
+ const toggleElement = computed(
84
+ () => toolbarButton.value?.el ?? null
85
+ );
86
+ const unreadCount = ref(null);
87
+ const POLL_INTERVAL_MS = 6e4;
88
+ let lastFetchAt = 0;
89
+ const fetchUnreadCount = async () => {
90
+ try {
91
+ unreadCount.value = await adapter.loadUnreadNotificationsCount();
92
+ lastFetchAt = Date.now();
93
+ } catch {
94
+ }
95
+ };
96
+ const maybeRefresh = () => {
97
+ if (isVisible.value || document.hidden) {
98
+ return;
99
+ }
100
+ if (Date.now() - lastFetchAt < POLL_INTERVAL_MS) {
101
+ return;
102
+ }
103
+ fetchUnreadCount();
104
+ };
105
+ let pollInterval = null;
106
+ onMounted(async () => {
107
+ await fetchUnreadCount();
108
+ pollInterval = setInterval(maybeRefresh, POLL_INTERVAL_MS);
109
+ document.addEventListener("visibilitychange", maybeRefresh);
110
+ });
111
+ onUnmounted(() => {
112
+ if (pollInterval) {
113
+ clearInterval(pollInterval);
114
+ }
115
+ document.removeEventListener("visibilitychange", maybeRefresh);
116
+ });
117
+ </script>
118
+
119
+ <script>
120
+ export default {
121
+ name: "Notifications"
122
+ };
123
+ </script>
@@ -0,0 +1,3 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;