@blokkli/editor 2.0.0-alpha.62 → 2.0.0-alpha.63

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 (128) hide show
  1. package/dist/global/types/colorOptions.d.ts +16 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +168 -14
  4. package/dist/modules/agent/runtime/app/components/Conversation/Item/Assistant/index.vue +14 -5
  5. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/ConversationsTab/Item.vue +2 -2
  6. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/RatingsTab/Item.vue +2 -2
  7. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/ConversationDetail.vue +2 -2
  8. package/dist/modules/agent/runtime/app/features/agent/Transcript/MessageContent.vue +14 -1
  9. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +30 -12
  10. package/dist/modules/agent/runtime/app/helpers/linkifyBlockUuids.d.ts +11 -0
  11. package/dist/modules/agent/runtime/app/helpers/linkifyBlockUuids.js +47 -0
  12. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.d.vue.ts +22 -0
  13. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue +28 -26
  14. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue.d.ts +22 -0
  15. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +15 -0
  16. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.d.vue.ts +22 -0
  17. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +59 -16
  18. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue.d.ts +22 -0
  19. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +15 -0
  20. package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.d.ts +85 -15
  21. package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +138 -28
  22. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +15 -5
  23. package/dist/modules/agent/runtime/app/tools/schemas.js +29 -12
  24. package/dist/modules/agent/runtime/app/tools/search_text/index.js +1 -1
  25. package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.d.vue.ts +22 -0
  26. package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue +54 -30
  27. package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue.d.ts +22 -0
  28. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +15 -0
  29. package/dist/modules/agent/runtime/server/default-system-prompts/architecture.js +1 -1
  30. package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +1 -0
  31. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +1 -1
  32. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +12 -5
  33. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +7 -16
  34. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +7 -77
  35. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/csvHelpers.d.ts +1 -1
  36. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +1 -1
  37. package/dist/modules/charts/runtime/helpers/index.d.ts +2 -1
  38. package/dist/modules/charts/runtime/helpers/index.js +4 -2
  39. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliMutationResult.graphql +3 -0
  40. package/dist/modules/drupal/runtime/adapter/index.js +2 -1
  41. package/dist/runtime/composables/useBlokkliRuntimeConfig.d.ts +50 -0
  42. package/dist/runtime/composables/useBlokkliRuntimeConfig.js +34 -0
  43. package/dist/runtime/editor/adapter/index.d.ts +2 -1
  44. package/dist/runtime/editor/components/ColorDropdown/index.d.vue.ts +26 -0
  45. package/dist/runtime/editor/components/ColorDropdown/index.vue +116 -0
  46. package/dist/runtime/editor/components/ColorDropdown/index.vue.d.ts +26 -0
  47. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +14 -20
  48. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +97 -52
  49. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +14 -20
  50. package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +6 -6
  51. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +30 -21
  52. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +6 -6
  53. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +19 -9
  54. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +18 -9
  55. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +19 -9
  56. package/dist/runtime/editor/components/DiffApproval/index.d.vue.ts +14 -6
  57. package/dist/runtime/editor/components/DiffApproval/index.vue +62 -35
  58. package/dist/runtime/editor/components/DiffApproval/index.vue.d.ts +14 -6
  59. package/dist/runtime/editor/components/DiffApproval/types.d.ts +32 -0
  60. package/dist/runtime/editor/components/DiffApproval/types.js +22 -0
  61. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +5 -4
  62. package/dist/runtime/editor/components/Dropdown/index.vue +89 -29
  63. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +5 -4
  64. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
  65. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
  66. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +2 -2
  67. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +3 -3
  68. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +2 -2
  69. package/dist/runtime/editor/components/PopupHost/index.d.vue.ts +13 -0
  70. package/dist/runtime/editor/components/PopupHost/index.vue +12 -0
  71. package/dist/runtime/editor/components/PopupHost/index.vue.d.ts +13 -0
  72. package/dist/runtime/editor/components/index.d.ts +2 -0
  73. package/dist/runtime/editor/components/index.js +2 -0
  74. package/dist/runtime/editor/css/output.css +1 -1
  75. package/dist/runtime/editor/features/analyze/Main.vue +15 -2
  76. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodes.vue +4 -1
  77. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +25 -16
  78. package/dist/runtime/editor/features/analyze/analyzers/defaults/validations.d.ts +10 -0
  79. package/dist/runtime/editor/features/analyze/analyzers/defaults/validations.js +39 -0
  80. package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.d.ts +5 -1
  81. package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.js +5 -0
  82. package/dist/runtime/editor/features/analyze/index.vue +0 -1
  83. package/dist/runtime/editor/features/changelog/changelog.json +9 -1
  84. package/dist/runtime/editor/features/comments/Comment/Meta/index.vue +1 -1
  85. package/dist/runtime/editor/features/comments/Comment/index.vue +1 -1
  86. package/dist/runtime/editor/features/publish/Dialog/Violations.d.vue.ts +12 -0
  87. package/dist/runtime/editor/features/publish/Dialog/Violations.vue +117 -0
  88. package/dist/runtime/editor/features/publish/Dialog/Violations.vue.d.ts +12 -0
  89. package/dist/runtime/editor/features/publish/Dialog/index.vue +61 -24
  90. package/dist/runtime/editor/features/publish/index.vue +2 -4
  91. package/dist/runtime/editor/features/publish/types.d.ts +0 -4
  92. package/dist/runtime/editor/helpers/color/index.d.ts +7 -0
  93. package/dist/runtime/editor/helpers/color/index.js +14 -0
  94. package/dist/runtime/editor/helpers/diff/index.d.ts +87 -0
  95. package/dist/runtime/editor/helpers/diff/index.js +256 -0
  96. package/dist/runtime/editor/helpers/injections.d.ts +11 -0
  97. package/dist/runtime/editor/helpers/injections.js +1 -0
  98. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  99. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  100. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
  101. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
  102. package/dist/runtime/editor/providers/analyze.js +5 -2
  103. package/dist/runtime/editor/providers/config.d.ts +3 -1
  104. package/dist/runtime/editor/providers/config.js +46 -15
  105. package/dist/runtime/editor/providers/state.d.ts +13 -0
  106. package/dist/runtime/editor/providers/state.js +7 -0
  107. package/dist/runtime/editor/translations/de.json +7 -4
  108. package/dist/runtime/editor/translations/fr.json +2 -4
  109. package/dist/runtime/editor/translations/gsw_CH.json +7 -4
  110. package/dist/runtime/editor/translations/it.json +2 -4
  111. package/dist/runtime/helpers/colors.d.ts +39 -0
  112. package/dist/runtime/helpers/colors.js +28 -0
  113. package/dist/runtime/types/colors.d.ts +11 -0
  114. package/package.json +1 -1
  115. package/dist/runtime/editor/features/validations/Overlay/Item.d.vue.ts +0 -7
  116. package/dist/runtime/editor/features/validations/Overlay/Item.vue +0 -36
  117. package/dist/runtime/editor/features/validations/Overlay/Item.vue.d.ts +0 -7
  118. package/dist/runtime/editor/features/validations/Overlay/index.d.vue.ts +0 -7
  119. package/dist/runtime/editor/features/validations/Overlay/index.vue +0 -115
  120. package/dist/runtime/editor/features/validations/Overlay/index.vue.d.ts +0 -7
  121. package/dist/runtime/editor/features/validations/SidebarItem/index.d.vue.ts +0 -10
  122. package/dist/runtime/editor/features/validations/SidebarItem/index.vue +0 -41
  123. package/dist/runtime/editor/features/validations/SidebarItem/index.vue.d.ts +0 -10
  124. package/dist/runtime/editor/features/validations/index.d.vue.ts +0 -3
  125. package/dist/runtime/editor/features/validations/index.vue +0 -91
  126. package/dist/runtime/editor/features/validations/index.vue.d.ts +0 -3
  127. package/dist/runtime/editor/types/config.d.ts +0 -5
  128. /package/dist/runtime/{editor/types/config.js → types/colors.js} +0 -0
@@ -94,6 +94,7 @@
94
94
  "commentsMarkAsUnresolved": "Segna come non risolto",
95
95
  "commentsShowResolved": "Mostra risolti",
96
96
  "deleteError": "L'elemento non può essere rimosso.",
97
+ "deleted": "eliminato",
97
98
  "duplicate": "Duplica",
98
99
  "duplicateError": "Gli elementi non possono essere duplicati.",
99
100
  "edit": "Modifica",
@@ -163,8 +164,5 @@
163
164
  "settingsDialogTitle": "Impostazioni",
164
165
  "settingsMenuDescription": "Impostazioni personali per l'editor",
165
166
  "structureToolbarLabel": "Struttura",
166
- "translationsBatchTranslateMenuDescription": "Traduci tutti gli elementi",
167
- "userDeleted": "[eliminato]",
168
- "validationsNoneFound": "Nessun errore di validazione trovato.",
169
- "validationsToolbarLabel": "Validazioni"
167
+ "translationsBatchTranslateMenuDescription": "Traduci tutti gli elementi"
170
168
  }
@@ -0,0 +1,39 @@
1
+ import type { ColorOption } from '../types/colors.js';
2
+ /**
3
+ * Pure runtime helpers for color identity and id validation. No Vue/Nuxt
4
+ * deps — safe to import from any layer (runtime components, editor
5
+ * providers, agent tools, tests).
6
+ *
7
+ * Id space:
8
+ * - Flat color: `<base>` (no dot)
9
+ * - Ramped color: `<base>.<shade>` (shade-qualified)
10
+ *
11
+ * The bare `<base>` form for a ramped color is NOT a valid color id anywhere
12
+ * in the system. Everything that emits ids — the editor's `ColorDropdown`,
13
+ * the chart helpers (`getColorIdAtIndex`), the agent's `chartColorEnum` —
14
+ * uses the canonical shade-qualified form.
15
+ *
16
+ * Hex resolution at runtime goes through
17
+ * `useBlokkliRuntimeConfig().resolveColorHex(id)`, which reads the merged
18
+ * view directly from `app.config.blokkli.colorOptions`. No merge function
19
+ * lives here — Nuxt's app.config layer already handles override merging.
20
+ */
21
+ export declare const FALLBACK_HEX = "#888888";
22
+ export declare function parseColorId(id: string): {
23
+ baseId: string;
24
+ shadeId: string | undefined;
25
+ };
26
+ /**
27
+ * Canonical id for a color option:
28
+ * - Flat color: the bare id.
29
+ * - Ramped color: `<base>.<mainShade>`. Falls back to the first declared
30
+ * shade if none is marked `isMain`.
31
+ */
32
+ export declare function canonicalColorId(option: ColorOption): string;
33
+ export declare function findColorOption(id: string, options: ColorOption[]): ColorOption | undefined;
34
+ /**
35
+ * Strict id validity: bare for flat colors, `<base>.<shade>` for ramped
36
+ * colors with the shade actually declared. Bare ids for ramped colors and
37
+ * shade-qualified ids for flat colors both return false.
38
+ */
39
+ export declare function isColorIdValid(id: string, options: ColorOption[]): boolean;
@@ -0,0 +1,28 @@
1
+ export const FALLBACK_HEX = "#888888";
2
+ export function parseColorId(id) {
3
+ const dotIndex = id.indexOf(".");
4
+ if (dotIndex === -1) {
5
+ return { baseId: id, shadeId: void 0 };
6
+ }
7
+ return {
8
+ baseId: id.slice(0, dotIndex),
9
+ shadeId: id.slice(dotIndex + 1)
10
+ };
11
+ }
12
+ export function canonicalColorId(option) {
13
+ if (!option.shades?.length) return option.id;
14
+ const main = option.shades.find((s) => s.isMain) ?? option.shades[0];
15
+ return `${option.id}.${main.id}`;
16
+ }
17
+ export function findColorOption(id, options) {
18
+ return options.find((c) => c.id === parseColorId(id).baseId);
19
+ }
20
+ export function isColorIdValid(id, options) {
21
+ const { baseId, shadeId } = parseColorId(id);
22
+ const option = options.find((c) => c.id === baseId);
23
+ if (!option) return false;
24
+ if (option.shades?.length) {
25
+ return shadeId !== void 0 && option.shades.some((s) => s.id === shadeId);
26
+ }
27
+ return shadeId === void 0;
28
+ }
@@ -0,0 +1,11 @@
1
+ export type ColorShade = {
2
+ id: string;
3
+ hex: string;
4
+ isMain: boolean;
5
+ };
6
+ export type ColorOption = {
7
+ id: string;
8
+ hex: string;
9
+ label: string;
10
+ shades?: ColorShade[];
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
- "version": "2.0.0-alpha.62",
3
+ "version": "2.0.0-alpha.63",
4
4
  "description": "Interactive page building experience for Nuxt",
5
5
  "keywords": [
6
6
  "cms",
@@ -1,7 +0,0 @@
1
- type __VLS_Props = {
2
- uuid: string;
3
- messages: string[];
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;
@@ -1,36 +0,0 @@
1
- <template>
2
- <div :style="style">
3
- <div v-html="messages.join(', ')" />
4
- </div>
5
- </template>
6
-
7
- <script setup>
8
- import { useBlokkli, ref, computed } from "#imports";
9
- import { onBlokkliEvent } from "#blokkli/editor/composables";
10
- const { dom } = useBlokkli();
11
- const props = defineProps({
12
- uuid: { type: String, required: true },
13
- messages: { type: Array, required: true }
14
- });
15
- const rect = ref(null);
16
- const style = computed(() => {
17
- if (!rect.value) {
18
- return;
19
- }
20
- return {
21
- transform: `translate(${rect.value.x}px, ${rect.value.y}px)`,
22
- width: rect.value.width + "px",
23
- height: rect.value.height + "px"
24
- };
25
- });
26
- onBlokkliEvent("canvas:draw", () => {
27
- const newRect = dom.getBlockRect(props.uuid);
28
- if (!newRect) {
29
- return;
30
- }
31
- if (newRect.width === rect.value?.width && newRect.height === rect.value.height && newRect.x === rect.value.x && newRect.y === rect.value.y) {
32
- return;
33
- }
34
- rect.value = newRect;
35
- });
36
- </script>
@@ -1,7 +0,0 @@
1
- type __VLS_Props = {
2
- uuid: string;
3
- messages: string[];
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;
@@ -1,7 +0,0 @@
1
- import type { Validation } from '#blokkli/editor/types/state';
2
- type __VLS_Props = {
3
- validations: Validation[];
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;
@@ -1,115 +0,0 @@
1
- <template>
2
- <Teleport to=".bk-main-canvas">
3
- <div class="bk bk-validations-overlay">
4
- <OverlayItem v-for="item in items" :key="item.uuid" v-bind="item" />
5
- </div>
6
- </Teleport>
7
- </template>
8
-
9
- <script setup>
10
- import { itemEntityType } from "#blokkli-build/config";
11
- import { falsy } from "#blokkli/helpers";
12
- import { computed } from "#imports";
13
- import OverlayItem from "./Item.vue";
14
- const props = defineProps({
15
- validations: { type: Array, required: true }
16
- });
17
- const items = computed(
18
- () => Object.entries(
19
- props.validations.map((v) => {
20
- if (v.entityType === itemEntityType && v.entityUuid) {
21
- return {
22
- uuid: v.entityUuid,
23
- message: v.message
24
- };
25
- }
26
- return null;
27
- }).filter(falsy).reduce((acc, v) => {
28
- if (!acc[v.uuid]) {
29
- acc[v.uuid] = [v.message];
30
- } else {
31
- acc[v.uuid].push(v.message);
32
- }
33
- return acc;
34
- }, {})
35
- ).map((v) => {
36
- return {
37
- uuid: v[0],
38
- messages: v[1]
39
- };
40
- })
41
- );
42
- </script>
43
-
44
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
45
- .bk.bk-validations-overlay {
46
- pointer-events: none;
47
- position: absolute;
48
- top: 0px;
49
- left: 0px;
50
- height: 100%;
51
- width: 100%;
52
- }
53
- .bk.bk-validations-overlay > div {
54
- position: absolute;
55
- top: 0px;
56
- left: 0px;
57
- box-sizing: border-box;
58
- border-style: var(--bk-tw-border-style);
59
- border-width: 3px;
60
- border-color: rgb(var(--bk-theme-red-normal) / 1);
61
- background-color: rgb(var(--bk-theme-red-normal) / 1);
62
- }
63
- @supports (color: color-mix(in lab, red, red)) {
64
- .bk.bk-validations-overlay > div {
65
- background-color: color-mix(in oklab, rgb(var(--bk-theme-red-normal) / 1) 10%, transparent);
66
- }
67
- }
68
- :is(.bk.bk-validations-overlay > div) > div {
69
- background-color: rgb(var(--bk-theme-red-normal) / 1);
70
- padding-inline: 10px;
71
- padding-block: 5px;
72
- color: white;
73
- position: absolute;
74
- right: calc(2px * -1);
75
- left: calc(2px * -1);
76
- --bk-tw-font-weight: var(--font-weight-bold, 700);
77
- font-weight: var(--font-weight-bold, 700);
78
- bottom: 100%;
79
- }
80
- .bk .bk-validation-item {
81
- width: 100%;
82
- padding: 15px;
83
- font-size: var(--text-base, 16px);
84
- line-height: var(--bk-tw-leading, var(--text-base--line-height, calc(1.5 / 1)));
85
- color: rgb(var(--bk-theme-mono-800) / 1);
86
- }
87
- @media (hover: hover) {
88
- :is(.bk .bk-validation-item):hover {
89
- background-color: rgb(var(--bk-theme-mono-50) / 1);
90
- }
91
- }
92
- .bk .bk-validation-item {
93
- border-bottom-style: var(--bk-tw-border-style);
94
- border-bottom-width: 1px;
95
- border-bottom-color: rgb(var(--bk-theme-mono-300) / 1);
96
- }
97
- :is(.bk .bk-validation-item) .bk-blokkli-item-icon {
98
- width: 25px;
99
- height: 25px;
100
- border-radius: 4px;
101
- border-style: var(--bk-tw-border-style);
102
- border-width: 1px;
103
- border-color: rgb(var(--bk-theme-mono-400) / 1);
104
- background-color: rgb(var(--bk-theme-mono-200) / 1);
105
- padding: 3px;
106
- }
107
- :is(.bk .bk-validation-item) .bk-validation-item-header {
108
- margin-bottom: 10px;
109
- display: flex;
110
- align-items: center;
111
- gap: 5px;
112
- --bk-tw-font-weight: var(--font-weight-medium, 500);
113
- font-weight: var(--font-weight-medium, 500);
114
- }
115
- </style>
@@ -1,7 +0,0 @@
1
- import type { Validation } from '#blokkli/editor/types/state';
2
- type __VLS_Props = {
3
- validations: Validation[];
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;
@@ -1,10 +0,0 @@
1
- type __VLS_Props = {
2
- message: string;
3
- propertyPath?: string;
4
- code?: string;
5
- entityType?: string;
6
- entityUuid?: string;
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
@@ -1,41 +0,0 @@
1
- <template>
2
- <button class="bk-validation-item" @click.prevent="onClick">
3
- <div v-if="block" class="bk-validation-item-header">
4
- <ItemIcon :bundle="block.bundle" />
5
- <div>{{ itemBundle?.label }}</div>
6
- </div>
7
- <div v-html="message" />
8
- </button>
9
- </template>
10
-
11
- <script setup>
12
- import { useBlokkli, computed } from "#imports";
13
- import { ItemIcon } from "#blokkli/editor/components";
14
- import { itemEntityType } from "#blokkli-build/config";
15
- const props = defineProps({
16
- message: { type: String, required: true },
17
- propertyPath: { type: String, required: false },
18
- code: { type: String, required: false },
19
- entityType: { type: String, required: false },
20
- entityUuid: { type: String, required: false }
21
- });
22
- const { eventBus, types, blocks } = useBlokkli();
23
- const isBlock = computed(() => props.entityType === itemEntityType);
24
- const block = computed(() => {
25
- if (isBlock.value && props.entityUuid) {
26
- return blocks.getBlock(props.entityUuid);
27
- }
28
- return null;
29
- });
30
- const itemBundle = computed(() => {
31
- if (block.value?.bundle) {
32
- return types.getBlockBundleDefinition(block.value.bundle);
33
- }
34
- return null;
35
- });
36
- function onClick() {
37
- if (isBlock.value && props.entityUuid) {
38
- eventBus.emit("scrollIntoView", { uuid: props.entityUuid, center: true });
39
- }
40
- }
41
- </script>
@@ -1,10 +0,0 @@
1
- type __VLS_Props = {
2
- message: string;
3
- propertyPath?: string;
4
- code?: string;
5
- entityType?: string;
6
- entityUuid?: string;
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
@@ -1,3 +0,0 @@
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>;
@@ -1,91 +0,0 @@
1
- <template>
2
- <PluginSidebar
3
- id="violations"
4
- ref="plugin"
5
- :title="$t('validationsToolbarLabel', 'Validations')"
6
- :tour-text="
7
- $t(
8
- 'validationsTourText',
9
- 'See validation errors for content or structure on the current page.'
10
- )
11
- "
12
- icon="bk_mdi_check"
13
- weight="-10"
14
- >
15
- <div class="bk bk-errors bk-control">
16
- <ul v-if="state.violations.value.length">
17
- <li v-for="(item, i) in state.violations.value" :key="item.message + i">
18
- <SidebarItem v-bind="item" />
19
- </li>
20
- </ul>
21
- <div v-else class="bk-errors-success">
22
- <figure>
23
- <Icon name="bk_mdi_check" />
24
- </figure>
25
- <h3>{{ $t("validationsNoneFound", "No validation errors found.") }}</h3>
26
- </div>
27
- </div>
28
-
29
- <template v-if="validations.length" #badge>
30
- <div class="bk-sidebar-badge bk-is-red">{{ validations.length }}</div>
31
- </template>
32
- </PluginSidebar>
33
-
34
- <ValidationOverlay v-if="validations.length" :validations="validations" />
35
- </template>
36
-
37
- <script setup>
38
- import {
39
- useBlokkli,
40
- defineBlokkliFeature,
41
- computed,
42
- useTemplateRef
43
- } from "#imports";
44
- import { PluginSidebar } from "#blokkli/editor/plugins";
45
- import { Icon } from "#blokkli/editor/components";
46
- import ValidationOverlay from "./Overlay/index.vue";
47
- import SidebarItem from "./SidebarItem/index.vue";
48
- import { onBlokkliEvent } from "#blokkli/editor/composables";
49
- defineBlokkliFeature({
50
- id: "validations",
51
- icon: "bk_mdi_check",
52
- label: "Validations",
53
- description: "Provides a sidebar pane to render validations."
54
- });
55
- const plugin = useTemplateRef("plugin");
56
- const { state, $t } = useBlokkli();
57
- const validations = computed(() => state.violations.value);
58
- onBlokkliEvent("publish:failed", function() {
59
- if (plugin.value && validations.value.length) {
60
- plugin.value.showSidebar();
61
- }
62
- });
63
- </script>
64
-
65
- <script>
66
- export default {
67
- name: "Validations"
68
- };
69
- </script>
70
-
71
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
72
- .bk.bk-errors .bk-errors-success {
73
- display: flex;
74
- flex-direction: column;
75
- align-items: center;
76
- padding-top: 30px;
77
- text-align: center;
78
- }
79
- :is(.bk.bk-errors .bk-errors-success) figure {
80
- margin-bottom: 20px;
81
- height: 100px;
82
- width: 100px;
83
- border-radius: calc(infinity * 1px);
84
- background-color: rgb(var(--bk-theme-lime-light) / 1);
85
- padding: 20px;
86
- color: rgb(var(--bk-theme-lime-dark) / 1);
87
- }
88
- :is(:is(.bk.bk-errors .bk-errors-success) figure) svg {
89
- fill: currentcolor;
90
- }
91
- </style>
@@ -1,3 +0,0 @@
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>;
@@ -1,5 +0,0 @@
1
- export type ColorOption = {
2
- id: string;
3
- hex: string;
4
- label: string;
5
- };