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

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 (225) hide show
  1. package/dist/global/types/blockOptions.d.ts +32 -27
  2. package/dist/module.d.mts +2 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +154 -5
  5. package/dist/modules/agent/index.d.mts +1 -1
  6. package/dist/modules/agent/index.mjs +2 -1
  7. package/dist/modules/agent/runtime/app/components/Attachment/PreviewCsv/index.vue +1 -1
  8. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.d.vue.ts +1 -1
  9. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.vue.d.ts +1 -1
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +1 -1
  11. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +1 -1
  12. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +1 -1
  13. package/dist/modules/agent/runtime/app/features/agent/index.vue +1 -1
  14. package/dist/modules/agent/runtime/app/helpers/mutationResult.d.ts +12 -0
  15. package/dist/modules/agent/runtime/app/helpers/mutationResult.js +34 -0
  16. package/dist/modules/agent/runtime/app/providers/toolsProvider.js +13 -7
  17. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +1 -1
  18. package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +1 -1
  19. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +1 -1
  20. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +16 -5
  21. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +43 -15
  22. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +1 -1
  23. package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +1 -1
  24. package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +1 -1
  25. package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -1
  26. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +1 -1
  27. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +1 -1
  28. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +1 -1
  29. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +1 -1
  30. package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +1 -3
  31. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -2
  32. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +6 -2
  33. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +3 -3
  34. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +5 -5
  35. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +1 -1
  36. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +1 -1
  37. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +1 -1
  38. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +1 -1
  39. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +1 -1
  40. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +1 -1
  41. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +1 -1
  42. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +2 -2
  43. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +1 -1
  44. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +1 -1
  45. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +3 -3
  46. package/dist/modules/agent/runtime/server/classes/FieldStreamParser/index.js +10 -15
  47. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.d.ts +1 -3
  48. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +3 -1
  49. package/dist/modules/agent/runtime/shared/toolParams.d.ts +3 -3
  50. package/dist/modules/agent/runtime/shared/types.d.ts +3 -3
  51. package/dist/modules/charts/index.d.mts +14 -1
  52. package/dist/modules/charts/index.mjs +37 -2
  53. package/dist/modules/charts/runtime/features/charts/Editor/AdvancedConfigPanel/index.vue +1 -1
  54. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/Field.vue +19 -9
  55. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue +1 -1
  56. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +16 -8
  57. package/dist/modules/charts/runtime/features/charts/Editor/NumberFormatEditor/index.vue +23 -7
  58. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +5 -6
  59. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
  60. package/dist/modules/drupal/index.d.mts +1 -1
  61. package/dist/modules/drupal/runtime/adapter/index.js +3 -0
  62. package/dist/modules/iframes/index.d.mts +1 -1
  63. package/dist/modules/index.d.mts +1 -1
  64. package/dist/modules/readability/index.d.mts +1 -1
  65. package/dist/modules/readability/index.mjs +2 -1
  66. package/dist/modules/table-of-contents/index.d.mts +1 -1
  67. package/dist/runtime/components/Blocks/NotImplemented/index.vue +1 -1
  68. package/dist/runtime/editor/components/Actions/Title/index.vue +1 -1
  69. package/dist/runtime/editor/components/Actions/index.vue +1 -1
  70. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
  71. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +2 -2
  72. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
  73. package/dist/runtime/editor/components/Avatar/index.vue +1 -1
  74. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +1 -1
  75. package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +1 -1
  76. package/dist/runtime/editor/components/BlockProxy/index.vue +1 -1
  77. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +1 -1
  78. package/dist/runtime/editor/components/BundleSelector/index.vue +1 -1
  79. package/dist/runtime/editor/components/ColorDropdown/index.vue +1 -1
  80. package/dist/runtime/editor/components/Dialog/index.vue +1 -1
  81. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +1 -1
  82. package/dist/runtime/editor/components/DiffApproval/types.js +1 -3
  83. package/dist/runtime/editor/components/DiffViewer/State.vue +1 -1
  84. package/dist/runtime/editor/components/DraggableList.vue +1 -1
  85. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +1 -0
  86. package/dist/runtime/editor/components/Dropdown/index.vue +2 -2
  87. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +1 -0
  88. package/dist/runtime/editor/components/DropdownItem/index.vue +1 -1
  89. package/dist/runtime/editor/components/EditIndicator.vue +1 -1
  90. package/dist/runtime/editor/components/EditProvider.vue +2 -2
  91. package/dist/runtime/editor/components/FileDropHandler/index.vue +1 -1
  92. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
  93. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
  94. package/dist/runtime/editor/components/Form/RadioTabs/index.vue +1 -1
  95. package/dist/runtime/editor/components/Form/Search/index.d.vue.ts +1 -0
  96. package/dist/runtime/editor/components/Form/Search/index.vue +2 -2
  97. package/dist/runtime/editor/components/Form/Search/index.vue.d.ts +1 -0
  98. package/dist/runtime/editor/components/FormOverlay/index.vue +1 -1
  99. package/dist/runtime/editor/components/Icon/index.vue +1 -1
  100. package/dist/runtime/editor/components/Indicators/index.vue +31 -100
  101. package/dist/runtime/editor/components/Konami/Game/index.vue +1 -1
  102. package/dist/runtime/editor/components/Messages/index.vue +1 -1
  103. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +1 -0
  104. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +2 -1
  105. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +1 -0
  106. package/dist/runtime/editor/components/Overlay/index.vue +1 -1
  107. package/dist/runtime/editor/components/Pagination/index.vue +1 -1
  108. package/dist/runtime/editor/components/Panel/Section/index.vue +1 -1
  109. package/dist/runtime/editor/components/Panel/Tabs/index.d.vue.ts +1 -1
  110. package/dist/runtime/editor/components/Panel/Tabs/index.vue.d.ts +1 -1
  111. package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -1
  112. package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +1 -1
  113. package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +1 -1
  114. package/dist/runtime/editor/components/Popup/index.vue +1 -1
  115. package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
  116. package/dist/runtime/editor/components/RelativeTime/index.vue +7 -13
  117. package/dist/runtime/editor/components/Resizable/index.vue +1 -1
  118. package/dist/runtime/editor/components/RichText/Editor/index.vue +1 -1
  119. package/dist/runtime/editor/components/ScaleToFit/index.vue +1 -1
  120. package/dist/runtime/editor/components/SearchOverlay/index.vue +1 -1
  121. package/dist/runtime/editor/components/SidebarFloater/index.vue +1 -1
  122. package/dist/runtime/editor/components/StatusIcon/index.vue +1 -1
  123. package/dist/runtime/editor/components/StatusIndicator/index.vue +1 -1
  124. package/dist/runtime/editor/components/SystemRequirements/index.vue +1 -1
  125. package/dist/runtime/editor/components/Tabs/index.d.vue.ts +1 -1
  126. package/dist/runtime/editor/components/Tabs/index.vue.d.ts +1 -1
  127. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +2 -1
  128. package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
  129. package/dist/runtime/editor/components/Transition/Collapse/index.vue +1 -1
  130. package/dist/runtime/editor/components/Transition/List/index.vue +1 -1
  131. package/dist/runtime/editor/composables/defineViewOption.js +5 -1
  132. package/dist/runtime/editor/composables/useStickyToolbar.js +1 -4
  133. package/dist/runtime/editor/css/output.css +1 -1
  134. package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
  135. package/dist/runtime/editor/features/add-list/index.vue +1 -1
  136. package/dist/runtime/editor/features/analyze/index.vue +1 -1
  137. package/dist/runtime/editor/features/anchors/Overlay/index.vue +11 -5
  138. package/dist/runtime/editor/features/anchors/index.vue +2 -1
  139. package/dist/runtime/editor/features/artboard/Overview/index.vue +1 -1
  140. package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
  141. package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +1 -1
  142. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
  143. package/dist/runtime/editor/features/block-transfer/index.vue +1 -1
  144. package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
  145. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  146. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +1 -1
  147. package/dist/runtime/editor/features/comments/AddForm/index.vue +1 -1
  148. package/dist/runtime/editor/features/comments/Thread/index.vue +1 -1
  149. package/dist/runtime/editor/features/complex-options/index.vue +1 -0
  150. package/dist/runtime/editor/features/debug/Main.vue +1 -1
  151. package/dist/runtime/editor/features/dev-mode/index.vue +1 -1
  152. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -1
  153. package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
  154. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +1 -1
  155. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +1 -1
  156. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +1 -5
  157. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +1 -5
  158. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  159. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +1 -1
  160. package/dist/runtime/editor/features/editable-mask/index.vue +1 -1
  161. package/dist/runtime/editor/features/entity-title/index.vue +17 -7
  162. package/dist/runtime/editor/features/help/Dialog/index.vue +1 -1
  163. package/dist/runtime/editor/features/help/Shortcuts/index.vue +1 -1
  164. package/dist/runtime/editor/features/history/List/index.vue +1 -1
  165. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +1 -1
  166. package/dist/runtime/editor/features/library/index.vue +1 -0
  167. package/dist/runtime/editor/features/media-library/index.vue +1 -1
  168. package/dist/runtime/editor/features/options/Form/Item.vue +5 -12
  169. package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +5 -4
  170. package/dist/runtime/editor/features/options/Form/Radios/index.vue +8 -5
  171. package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +5 -4
  172. package/dist/runtime/editor/features/options/Form/Text/index.d.vue.ts +4 -0
  173. package/dist/runtime/editor/features/options/Form/Text/index.vue +11 -3
  174. package/dist/runtime/editor/features/options/Form/Text/index.vue.d.ts +4 -0
  175. package/dist/runtime/editor/features/options/index.vue +1 -1
  176. package/dist/runtime/editor/features/publish/Dialog/Item.vue +4 -7
  177. package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +1 -1
  178. package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +1 -0
  179. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +1 -1
  180. package/dist/runtime/editor/features/search/index.vue +1 -1
  181. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
  182. package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +1 -1
  183. package/dist/runtime/editor/features/settings/index.vue +1 -1
  184. package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -1
  185. package/dist/runtime/editor/features/structure/index.vue +1 -1
  186. package/dist/runtime/editor/features/templates/DialogManageTemplates/Item.vue +1 -0
  187. package/dist/runtime/editor/features/templates/DialogManageTemplates/index.vue +1 -1
  188. package/dist/runtime/editor/features/theme/index.vue +1 -1
  189. package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +1 -1
  190. package/dist/runtime/editor/features/tour/Overlay/index.vue +1 -1
  191. package/dist/runtime/editor/features/transform/Dialog/index.vue +1 -1
  192. package/dist/runtime/editor/features/translations/SelectionTable/index.vue +1 -1
  193. package/dist/runtime/editor/features/workspace/index.vue +1 -1
  194. package/dist/runtime/editor/helpers/diff/index.d.ts +11 -0
  195. package/dist/runtime/editor/helpers/diff/index.js +13 -7
  196. package/dist/runtime/editor/helpers/options/index.d.ts +2 -0
  197. package/dist/runtime/editor/helpers/options/index.js +21 -0
  198. package/dist/runtime/editor/plugins/BlockIndicator/index.d.vue.ts +24 -1
  199. package/dist/runtime/editor/plugins/BlockIndicator/index.vue +17 -7
  200. package/dist/runtime/editor/plugins/BlockIndicator/index.vue.d.ts +24 -1
  201. package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +2 -1
  202. package/dist/runtime/editor/plugins/ItemAction/index.vue +1 -1
  203. package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +2 -1
  204. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  205. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  206. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
  207. package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
  208. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
  209. package/dist/runtime/editor/plugins/ToolbarButton/index.vue +1 -1
  210. package/dist/runtime/editor/providers/animation.d.ts +2 -0
  211. package/dist/runtime/editor/providers/definition.d.ts +4 -3
  212. package/dist/runtime/editor/providers/definition.js +10 -2
  213. package/dist/runtime/editor/providers/plugin.d.ts +1 -0
  214. package/dist/runtime/editor/providers/state.d.ts +25 -1
  215. package/dist/runtime/editor/providers/state.js +17 -0
  216. package/dist/runtime/editor/translations/de.json +2 -0
  217. package/dist/runtime/editor/translations/fr.json +2 -0
  218. package/dist/runtime/editor/translations/gsw_CH.json +2 -0
  219. package/dist/runtime/editor/translations/it.json +2 -0
  220. package/dist/runtime/editor/types/state.d.ts +7 -0
  221. package/dist/runtime/editor/types/ui.d.ts +1 -0
  222. package/dist/shared/{editor.Gu7mgJ5Q.mjs → editor.BGemL1Oh.mjs} +146 -146
  223. package/dist/shared/{editor.D28NbXr3.d.mts → editor.S5sA3rij.d.mts} +452 -406
  224. package/dist/types.d.mts +1 -1
  225. package/package.json +74 -82
@@ -3,7 +3,7 @@ import type { BlockDefinition, FragmentDefinition, ProviderDefinition } from '#b
3
3
  import type { ValidFieldListTypes, BlockBundleWithNested, ValidProviderTypes } from '#blokkli-build/generated-types';
4
4
  import type { DeepReadonly } from 'vue';
5
5
  import type { BlockDefinitionOptionsInput } from '../../types/definitions.js';
6
- import type { RuntimeBlockOptionArray } from '../../../global/types/blockOptions.js';
6
+ import type { DefinitionString, RuntimeBlockOptionArray } from '../../../global/types/blockOptions.js';
7
7
  import type { RenderedFieldListItem } from '../types/field.js';
8
8
  export type DefinitionProvider = {
9
9
  /**
@@ -14,7 +14,7 @@ export type DefinitionProvider = {
14
14
  * 2. Parent bundle specific (e.g., bundle__parent:accordion)
15
15
  * 3. Default bundle definition
16
16
  *
17
- * @param bundle - The block bundle name
17
+ * @param bundleOrBlock - The block bundle name, or a rendered field list item
18
18
  * @param fieldListType - The field list type context
19
19
  * @param parentBundle - Optional parent block bundle for nested blocks
20
20
  * @returns The block definition, or undefined if not found
@@ -95,5 +95,6 @@ export type DefinitionProvider = {
95
95
  * Block bundles that can be added automatically without showing the form.
96
96
  */
97
97
  bundlesWithAutoAdd: ComputedRef<string[]>;
98
+ resolveDefinitionString: (definitionString: DefinitionString) => string;
98
99
  };
99
- export default function (providerType: ValidProviderTypes): DefinitionProvider;
100
+ export default function (providerType: ValidProviderTypes, interfaceLanguage: ComputedRef<string>): DefinitionProvider;
@@ -1,7 +1,8 @@
1
1
  import { computed, ref, readonly } from "#imports";
2
2
  import definitions from "#blokkli-build/definitions";
3
3
  import { OPTIONS } from "#blokkli-build/runtime-options";
4
- export default function(providerType) {
4
+ import { resolveDefinitionString as resolveDefinitionStringBase } from "../helpers/options/index.js";
5
+ export default function(providerType, interfaceLanguage) {
5
6
  const blocks = ref(definitions.blocks);
6
7
  const fragments = ref(definitions.fragments);
7
8
  const providers = ref(definitions.providers);
@@ -114,6 +115,12 @@ export default function(providerType) {
114
115
  return addBehaviour === "no-form" || addBehaviour.startsWith("editable:");
115
116
  }).map((v) => v.bundle);
116
117
  });
118
+ function resolveDefinitionString(definitionString) {
119
+ return resolveDefinitionStringBase(
120
+ definitionString,
121
+ interfaceLanguage.value
122
+ );
123
+ }
117
124
  return {
118
125
  getBlockDefinition,
119
126
  getFragmentDefinition,
@@ -126,7 +133,8 @@ export default function(providerType) {
126
133
  globalOptions: readonly(allGlobalOptions),
127
134
  runtimeOptions: readonly(runtimeOptions),
128
135
  renderKey: readonly(renderKey),
129
- bundlesWithAutoAdd
136
+ bundlesWithAutoAdd,
137
+ resolveDefinitionString
130
138
  };
131
139
  }
132
140
  if (import.meta.hot) {
@@ -47,6 +47,7 @@ export type ViewOption = {
47
47
  keyCode?: string;
48
48
  tourText?: string;
49
49
  weight?: number;
50
+ default?: boolean;
50
51
  };
51
52
  type ViewOptionFunction = PluginAddFunction<ViewOption>;
52
53
  type PluginFunctionMap = {
@@ -1,5 +1,5 @@
1
1
  import { type Ref, type ComputedRef } from 'vue';
2
- import type { BlokkliAdapter, AdapterContext } from '../adapter/index.js';
2
+ import type { BlokkliAdapter, AdapterContext, MutationResponseLike } from '../adapter/index.js';
3
3
  import type { FieldListItem } from '#blokkli/types';
4
4
  import { type BlokkliEventBus } from '#blokkli/editor/events';
5
5
  import type { TextProvider } from './texts.js';
@@ -78,6 +78,14 @@ export type StateProvider = {
78
78
  * -1 indicates no mutations, 0+ indicates active mutation index.
79
79
  */
80
80
  currentMutationIndex: Readonly<Ref<number>>;
81
+ /**
82
+ * Unix timestamp (in seconds) of when the edit state was last changed, or
83
+ * `null` if there are no changes yet. Updates after every mutation.
84
+ *
85
+ * Distinct from `publishOptions.lastChanged`, which is the published entity's
86
+ * change time.
87
+ */
88
+ lastChanged: Readonly<Ref<number | null>>;
81
89
  /**
82
90
  * Validation violations for the current state.
83
91
  *
@@ -108,6 +116,22 @@ export type StateProvider = {
108
116
  * response, or `null`/`undefined` to no-op.
109
117
  */
110
118
  applyMutationState: (rawState: unknown) => void;
119
+ /**
120
+ * Run an adapter mutation with the loading lock, but return the raw response
121
+ * instead of a boolean and never emit an error toast.
122
+ *
123
+ * Like {@link mutateWithLoadingState} it locks the body for the duration of
124
+ * the call and applies any returned `state`, but it does NOT throw or show a
125
+ * global error message on failure. The caller receives the full
126
+ * {@link MutationResponseLike} and is responsible for surfacing violations —
127
+ * used by the agent tool runner, where the conversation UI already indicates
128
+ * that a tool errored and a global editor toast would be redundant.
129
+ *
130
+ * @param callback - Function that performs the mutation.
131
+ * @returns The raw mutation response, or `undefined` if no callback was
132
+ * provided or it resolved to no response.
133
+ */
134
+ applyMutationSilently: (callback: () => Promise<MutationResponseLike<any>> | undefined) => Promise<MutationResponseLike<any> | undefined>;
111
135
  /**
112
136
  * Current edit mode.
113
137
  *
@@ -49,6 +49,7 @@ export default async function(eventBus, adapter, context, $t, providerKey, permi
49
49
  });
50
50
  const currentMutationIndex = ref(-1);
51
51
  const isLoading = ref(false);
52
+ const lastChanged = ref(null);
52
53
  const entity = ref({
53
54
  label: "",
54
55
  status: false,
@@ -135,6 +136,7 @@ export default async function(eventBus, adapter, context, $t, providerKey, permi
135
136
  entity.value.label = context2?.entity?.label;
136
137
  entity.value.status = context2?.entity?.status;
137
138
  entity.value.bundleLabel = context2?.entity?.bundleLabel || "";
139
+ lastChanged.value = context2?.lastChanged ?? null;
138
140
  updatePublishOptions(mapPublishOptions(context2));
139
141
  translation.value.isTranslatable = !!context2?.translationState?.isTranslatable;
140
142
  translation.value.translations = context2?.translationState?.translations?.filter(falsy) || [];
@@ -317,6 +319,19 @@ export default async function(eventBus, adapter, context, $t, providerKey, permi
317
319
  unlockBody();
318
320
  return false;
319
321
  };
322
+ const applyMutationSilently = async (callback) => {
323
+ if (!callback) {
324
+ return void 0;
325
+ }
326
+ lockBody();
327
+ try {
328
+ const response = await callback();
329
+ applyMutationState(response?.state);
330
+ return response;
331
+ } finally {
332
+ unlockBody();
333
+ }
334
+ };
320
335
  async function loadState() {
321
336
  try {
322
337
  const state = await adapter.loadState();
@@ -396,8 +411,10 @@ export default async function(eventBus, adapter, context, $t, providerKey, permi
396
411
  mutations,
397
412
  violations,
398
413
  currentMutationIndex,
414
+ lastChanged: readonly(lastChanged),
399
415
  mutateWithLoadingState,
400
416
  applyMutationState,
417
+ applyMutationSilently,
401
418
  editMode,
402
419
  canEdit,
403
420
  isLoading: readonly(isLoading),
@@ -585,6 +585,7 @@
585
585
  "editableFieldFullscreen": "Vollbild",
586
586
  "editableFieldTranslateTooltip": "Den aktuellen Text automatisch übersetzen.",
587
587
  "editingDisabled": "Bearbeiten ist für diesen Blocktyp deaktiviert.",
588
+ "entityTitleLastChanged": "Zuletzt geändert",
588
589
  "entityTitleTourText": "<p>Zeigt den Titel und Status der aktuellen Seite an.</p><p>Klicken Sie auf den Titel um das Bearbeitungsformular anzuzeigen.</p>",
589
590
  "entityTitleTourTitle": "Seite",
590
591
  "errorCapturedMessage": "Fehler in «@label»: @errorMessage",
@@ -783,6 +784,7 @@
783
784
  "relatedContent": "Verwandte Inhalte",
784
785
  "relatedContentNoEntitiesFound": "Keine verwandten Inhalte gefunden",
785
786
  "relatedContentTooltip": "Inhalte wie Seiten oder Bilder, die von diesem Block referenziert oder verlinkt werden.",
787
+ "relativeTimeJustNow": "gerade eben",
786
788
  "remove": "Entfernen",
787
789
  "replaceField": "@field ersetzen",
788
790
  "reply": "Antworten",
@@ -98,6 +98,7 @@
98
98
  "duplicate": "Dupliquer",
99
99
  "duplicateError": "Les éléments n'ont pas pu être dupliqués.",
100
100
  "edit": "Modifier",
101
+ "entityTitleLastChanged": "Dernière modification",
101
102
  "exitDescription": "Fermer l’éditeur sans publier",
102
103
  "failedToConvert": "L'élément n'a pas pu être converti.",
103
104
  "failedToTransform": "The action \"@name\" could not be executed.",
@@ -150,6 +151,7 @@
150
151
  "readabilityTooShort": "Trop court",
151
152
  "readabilityTooShortTooltip": "Le texte nécessite au moins @count mots pour l'analyse de lisibilité.",
152
153
  "readabilityTooltipDescription": "@label mesure la facilité de lecture du texte.",
154
+ "relativeTimeJustNow": "à l'instant",
153
155
  "revertDialogLead": "Cela supprimera toutes les modifications et restaurera l’état actuellement publié. Cette action est irréversible.",
154
156
  "revertDialogSubmit": "Annuler les modifications",
155
157
  "revertDialogTitle": "Annuler les modifications de façon irréversible",
@@ -585,6 +585,7 @@
585
585
  "editableFieldFullscreen": "Vollbild",
586
586
  "editableFieldTranslateTooltip": "Den aktuellen Text automatisch übersetzen.",
587
587
  "editingDisabled": "Bearbeiten ist für diesen Blocktyp deaktiviert.",
588
+ "entityTitleLastChanged": "Zletscht gänderet",
588
589
  "entityTitleTourText": "<p>Zeigt dr Titel und Status vo dr aktuälle Sitte aa.</p><p>Klick uf dr Titel zum s'Sitte-Bearbeitsformular z'öffne.</p>",
589
590
  "entityTitleTourTitle": "Sitte",
590
591
  "errorCapturedMessage": "Fähler in «@label»: @errorMessage",
@@ -783,6 +784,7 @@
783
784
  "relatedContent": "Verwandte Inhalte",
784
785
  "relatedContentNoEntitiesFound": "Keine verwandten Inhalte gefunden",
785
786
  "relatedContentTooltip": "Inhalte wie Seiten oder Bilder, die von diesem Block referenziert oder verlinkt werden.",
787
+ "relativeTimeJustNow": "grad ebe",
786
788
  "remove": "Entfernen",
787
789
  "replaceField": "@field ersetzen",
788
790
  "reply": "Antworten",
@@ -98,6 +98,7 @@
98
98
  "duplicate": "Duplica",
99
99
  "duplicateError": "Gli elementi non possono essere duplicati.",
100
100
  "edit": "Modifica",
101
+ "entityTitleLastChanged": "Ultima modifica",
101
102
  "exitDescription": "Chiudi l'editor senza pubblicare",
102
103
  "failedToConvert": "L'elemento non può essere convertito.",
103
104
  "failedToTransform": "The action \"@name\" could not be executed.",
@@ -150,6 +151,7 @@
150
151
  "readabilityTooShort": "Troppo breve",
151
152
  "readabilityTooShortTooltip": "Il testo necessita di almeno @count parole per l'analisi della leggibilità.",
152
153
  "readabilityTooltipDescription": "@label misura quanto è facile leggere il testo.",
154
+ "relativeTimeJustNow": "proprio ora",
153
155
  "revertDialogLead": "Questo eliminerà tutte le modifiche e ripristinerà lo stato attualmente pubblicato. Questa azione non può essere annullata.",
154
156
  "revertDialogSubmit": "Scarta modifiche",
155
157
  "revertDialogTitle": "Scarta irrevocabilmente le modifiche",
@@ -50,6 +50,13 @@ export interface MappedState {
50
50
  mutations: MutationItem[];
51
51
  currentUserIsOwner: boolean;
52
52
  ownerName: string;
53
+ /**
54
+ * Unix timestamp (in seconds) of when the edit state was last changed.
55
+ *
56
+ * This is the edit state's own `changed` time (it bumps on every mutation),
57
+ * distinct from `publishOptions.lastChanged`, which is the published entity's.
58
+ */
59
+ lastChanged?: number;
53
60
  ownerId?: string;
54
61
  mutatedState?: {
55
62
  mutatedOptions?: any;
@@ -43,5 +43,6 @@ export type BlockIndicator = {
43
43
  uuid: string;
44
44
  element: HTMLElement;
45
45
  position: 'left' | 'right';
46
+ sticky?: boolean;
46
47
  };
47
48
  export type Placement = 'above-before' | 'above-left' | 'above-center' | 'above-right' | 'above-after' | 'below-before' | 'below-left' | 'below-center' | 'below-right' | 'below-after' | 'top-before' | 'top-after' | 'center-before' | 'center-after' | 'bottom-before' | 'bottom-after';
@@ -1,151 +1,6 @@
1
1
  import * as ts from 'typescript';
2
2
  import { parseAndWalk } from 'oxc-walker';
3
3
 
4
- class CollectedFile {
5
- constructor(filePath, fileContents) {
6
- this.filePath = filePath;
7
- this.fileContents = fileContents;
8
- }
9
- async handleChange(_helper) {
10
- return Promise.resolve(true);
11
- }
12
- /**
13
- * Validate the collected file and return any errors.
14
- * Override this method in subclasses to add validation logic.
15
- */
16
- validate(_icons) {
17
- return [];
18
- }
19
- }
20
- class Collector {
21
- constructor(helper) {
22
- this.helper = helper;
23
- this.files = /* @__PURE__ */ new Map();
24
- }
25
- files;
26
- needsFileContents = true;
27
- async addFile(filePath) {
28
- if (this.needsFileContents) {
29
- const contents = await this.helper.fileCache.read(filePath);
30
- const file = this.createCollectedFile(filePath, contents.toString());
31
- await file.handleChange(this.helper);
32
- this.files.set(filePath, file);
33
- } else {
34
- const file = this.createCollectedFile(filePath);
35
- await file.handleChange(this.helper);
36
- this.files.set(filePath, file);
37
- }
38
- }
39
- async handleAdd(filePath) {
40
- const applies = await this.applies(filePath);
41
- if (applies) {
42
- await this.addFile(filePath);
43
- return true;
44
- }
45
- return false;
46
- }
47
- async handleChange(filePath) {
48
- const applies = await this.applies(filePath);
49
- if (!applies) {
50
- return this.handleUnlink(filePath);
51
- }
52
- const file = this.files.get(filePath);
53
- if (!file) {
54
- return false;
55
- }
56
- if (this.needsFileContents) {
57
- const contents = await this.helper.fileCache.read(filePath);
58
- file.fileContents = contents.toString();
59
- return await file.handleChange(this.helper);
60
- }
61
- return true;
62
- }
63
- handleUnlink(filePath) {
64
- if (this.files.has(filePath)) {
65
- this.files.delete(filePath);
66
- return true;
67
- }
68
- return false;
69
- }
70
- handleAddDir() {
71
- return false;
72
- }
73
- handleUnlinkDir(folderPath) {
74
- const allKeys = [...this.files.keys()];
75
- const toRemove = allKeys.filter((filePath) => filePath.includes(folderPath));
76
- if (toRemove.length) {
77
- toRemove.forEach((key) => this.files.delete(key));
78
- return true;
79
- }
80
- return false;
81
- }
82
- async handleWatchEvent(event, filePath) {
83
- let hasChanged = false;
84
- if (event === "add") {
85
- hasChanged = await this.handleAdd(filePath);
86
- } else if (event === "change") {
87
- hasChanged = await this.handleChange(filePath);
88
- } else if (event === "unlink") {
89
- hasChanged = await this.handleUnlink(filePath);
90
- } else if (event === "addDir") {
91
- hasChanged = this.handleAddDir();
92
- } else if (event === "unlinkDir") {
93
- hasChanged = this.handleUnlinkDir(filePath);
94
- }
95
- return { hasChanged };
96
- }
97
- /**
98
- * Validate all collected files and log any errors/warnings to the console.
99
- * @returns true if there are validation errors (not warnings), false otherwise.
100
- */
101
- validate(icons) {
102
- const allIssues = [];
103
- for (const file of this.files.values()) {
104
- const issues = file.validate(icons);
105
- if (issues.length > 0) {
106
- allIssues.push({ filePath: file.filePath, issues });
107
- }
108
- }
109
- if (allIssues.length === 0) {
110
- return false;
111
- }
112
- const errors = [];
113
- const warnings = [];
114
- for (const { filePath, issues } of allIssues) {
115
- const fileErrors = issues.filter((i) => i.severity !== "warning");
116
- const fileWarnings = issues.filter((i) => i.severity === "warning");
117
- if (fileErrors.length > 0) {
118
- errors.push({ filePath, issues: fileErrors });
119
- }
120
- if (fileWarnings.length > 0) {
121
- warnings.push({ filePath, issues: fileWarnings });
122
- }
123
- }
124
- if (warnings.length > 0) {
125
- const lines = warnings.flatMap(({ filePath, issues }) => [
126
- ` ${filePath}:`,
127
- ...issues.map((e) => ` - ${e.message}`)
128
- ]);
129
- this.helper.logger.warn(
130
- `bl\xF6kkli validation warnings:
131
- ${lines.join("\n")}`
132
- );
133
- }
134
- if (errors.length > 0) {
135
- const lines = errors.flatMap(({ filePath, issues }) => [
136
- ` ${filePath}:`,
137
- ...issues.map((e) => ` - ${e.message}`)
138
- ]);
139
- this.helper.logger.error(
140
- `bl\xF6kkli validation errors:
141
- ${lines.join("\n")}`
142
- );
143
- return true;
144
- }
145
- return false;
146
- }
147
- }
148
-
149
4
  function sortObjectKeys(obj) {
150
5
  if (Array.isArray(obj)) {
151
6
  return obj.map(sortObjectKeys);
@@ -317,4 +172,149 @@ function onlyUnique(value, index, self) {
317
172
  return self.indexOf(value) === index;
318
173
  }
319
174
 
320
- export { Collector as C, CollectedFile as a, extractStringProperty as b, extractObjectLiteral as c, extractFirstStringArg as e, falsy as f, onlyUnique as o, parseTsObject as p, sortObjectKeys as s, toValidVariableName as t };
175
+ class CollectedFile {
176
+ constructor(filePath, fileContents) {
177
+ this.filePath = filePath;
178
+ this.fileContents = fileContents;
179
+ }
180
+ async handleChange(_helper) {
181
+ return Promise.resolve(true);
182
+ }
183
+ /**
184
+ * Validate the collected file and return any errors.
185
+ * Override this method in subclasses to add validation logic.
186
+ */
187
+ validate(_icons) {
188
+ return [];
189
+ }
190
+ }
191
+ class Collector {
192
+ constructor(helper) {
193
+ this.helper = helper;
194
+ this.files = /* @__PURE__ */ new Map();
195
+ }
196
+ files;
197
+ needsFileContents = true;
198
+ async addFile(filePath) {
199
+ if (this.needsFileContents) {
200
+ const contents = await this.helper.fileCache.read(filePath);
201
+ const file = this.createCollectedFile(filePath, contents.toString());
202
+ await file.handleChange(this.helper);
203
+ this.files.set(filePath, file);
204
+ } else {
205
+ const file = this.createCollectedFile(filePath);
206
+ await file.handleChange(this.helper);
207
+ this.files.set(filePath, file);
208
+ }
209
+ }
210
+ async handleAdd(filePath) {
211
+ const applies = await this.applies(filePath);
212
+ if (applies) {
213
+ await this.addFile(filePath);
214
+ return true;
215
+ }
216
+ return false;
217
+ }
218
+ async handleChange(filePath) {
219
+ const applies = await this.applies(filePath);
220
+ if (!applies) {
221
+ return this.handleUnlink(filePath);
222
+ }
223
+ const file = this.files.get(filePath);
224
+ if (!file) {
225
+ return false;
226
+ }
227
+ if (this.needsFileContents) {
228
+ const contents = await this.helper.fileCache.read(filePath);
229
+ file.fileContents = contents.toString();
230
+ return await file.handleChange(this.helper);
231
+ }
232
+ return true;
233
+ }
234
+ handleUnlink(filePath) {
235
+ if (this.files.has(filePath)) {
236
+ this.files.delete(filePath);
237
+ return true;
238
+ }
239
+ return false;
240
+ }
241
+ handleAddDir() {
242
+ return false;
243
+ }
244
+ handleUnlinkDir(folderPath) {
245
+ const allKeys = [...this.files.keys()];
246
+ const toRemove = allKeys.filter((filePath) => filePath.includes(folderPath));
247
+ if (toRemove.length) {
248
+ toRemove.forEach((key) => this.files.delete(key));
249
+ return true;
250
+ }
251
+ return false;
252
+ }
253
+ async handleWatchEvent(event, filePath) {
254
+ let hasChanged = false;
255
+ if (event === "add") {
256
+ hasChanged = await this.handleAdd(filePath);
257
+ } else if (event === "change") {
258
+ hasChanged = await this.handleChange(filePath);
259
+ } else if (event === "unlink") {
260
+ hasChanged = await this.handleUnlink(filePath);
261
+ } else if (event === "addDir") {
262
+ hasChanged = this.handleAddDir();
263
+ } else if (event === "unlinkDir") {
264
+ hasChanged = this.handleUnlinkDir(filePath);
265
+ }
266
+ return { hasChanged };
267
+ }
268
+ /**
269
+ * Validate all collected files and log any errors/warnings to the console.
270
+ * @returns true if there are validation errors (not warnings), false otherwise.
271
+ */
272
+ validate(icons) {
273
+ const allIssues = [];
274
+ for (const file of this.files.values()) {
275
+ const issues = file.validate(icons);
276
+ if (issues.length > 0) {
277
+ allIssues.push({ filePath: file.filePath, issues });
278
+ }
279
+ }
280
+ if (allIssues.length === 0) {
281
+ return false;
282
+ }
283
+ const errors = [];
284
+ const warnings = [];
285
+ for (const { filePath, issues } of allIssues) {
286
+ const fileErrors = issues.filter((i) => i.severity !== "warning");
287
+ const fileWarnings = issues.filter((i) => i.severity === "warning");
288
+ if (fileErrors.length > 0) {
289
+ errors.push({ filePath, issues: fileErrors });
290
+ }
291
+ if (fileWarnings.length > 0) {
292
+ warnings.push({ filePath, issues: fileWarnings });
293
+ }
294
+ }
295
+ if (warnings.length > 0) {
296
+ const lines = warnings.flatMap(({ filePath, issues }) => [
297
+ ` ${filePath}:`,
298
+ ...issues.map((e) => ` - ${e.message}`)
299
+ ]);
300
+ this.helper.logger.warn(
301
+ `bl\xF6kkli validation warnings:
302
+ ${lines.join("\n")}`
303
+ );
304
+ }
305
+ if (errors.length > 0) {
306
+ const lines = errors.flatMap(({ filePath, issues }) => [
307
+ ` ${filePath}:`,
308
+ ...issues.map((e) => ` - ${e.message}`)
309
+ ]);
310
+ this.helper.logger.error(
311
+ `bl\xF6kkli validation errors:
312
+ ${lines.join("\n")}`
313
+ );
314
+ return true;
315
+ }
316
+ return false;
317
+ }
318
+ }
319
+
320
+ export { Collector as C, CollectedFile as a, extractFirstStringArg as b, extractObjectLiteral as c, extractStringProperty as e, falsy as f, onlyUnique as o, parseTsObject as p, sortObjectKeys as s, toValidVariableName as t };