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

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 (312) hide show
  1. package/dist/global/types/blockOptions.d.ts +32 -27
  2. package/dist/global/types/colorOptions.d.ts +16 -0
  3. package/dist/module.d.mts +2 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +275 -18
  6. package/dist/modules/agent/index.d.mts +1 -1
  7. package/dist/modules/agent/index.mjs +2 -1
  8. package/dist/modules/agent/runtime/app/components/Attachment/PreviewCsv/index.vue +1 -1
  9. package/dist/modules/agent/runtime/app/components/Conversation/Item/Assistant/index.vue +14 -5
  10. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/ConversationsTab/Item.vue +2 -2
  11. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/RatingsTab/Item.vue +2 -2
  12. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/ConversationDetail.vue +2 -2
  13. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.d.vue.ts +1 -1
  14. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.vue.d.ts +1 -1
  15. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +1 -1
  16. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +1 -1
  17. package/dist/modules/agent/runtime/app/features/agent/Transcript/MessageContent.vue +14 -1
  18. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +31 -13
  19. package/dist/modules/agent/runtime/app/features/agent/index.vue +1 -1
  20. package/dist/modules/agent/runtime/app/helpers/linkifyBlockUuids.d.ts +11 -0
  21. package/dist/modules/agent/runtime/app/helpers/linkifyBlockUuids.js +47 -0
  22. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +1 -1
  23. package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +1 -1
  24. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +1 -1
  25. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +1 -1
  26. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +1 -1
  27. package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +1 -1
  28. package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +1 -1
  29. package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -1
  30. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.d.vue.ts +22 -0
  31. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue +28 -26
  32. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue.d.ts +22 -0
  33. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +16 -1
  34. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.d.vue.ts +22 -0
  35. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +59 -16
  36. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue.d.ts +22 -0
  37. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +15 -0
  38. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +1 -1
  39. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +1 -1
  40. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +1 -1
  41. package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.d.ts +85 -15
  42. package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +136 -28
  43. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -2
  44. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +6 -2
  45. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +3 -3
  46. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +5 -5
  47. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +1 -1
  48. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +1 -1
  49. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +1 -1
  50. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +1 -1
  51. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +1 -1
  52. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +1 -1
  53. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +1 -1
  54. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +17 -7
  55. package/dist/modules/agent/runtime/app/tools/schemas.js +29 -12
  56. package/dist/modules/agent/runtime/app/tools/search_text/index.js +1 -1
  57. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +1 -1
  58. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +1 -1
  59. package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.d.vue.ts +22 -0
  60. package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue +54 -30
  61. package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue.d.ts +22 -0
  62. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +18 -3
  63. package/dist/modules/agent/runtime/server/classes/FieldStreamParser/index.js +10 -15
  64. package/dist/modules/agent/runtime/server/default-system-prompts/architecture.js +1 -1
  65. package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +1 -0
  66. package/dist/modules/agent/runtime/shared/toolParams.d.ts +3 -3
  67. package/dist/modules/agent/runtime/shared/types.d.ts +3 -3
  68. package/dist/modules/charts/index.d.mts +14 -1
  69. package/dist/modules/charts/index.mjs +37 -2
  70. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +1 -1
  71. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +12 -5
  72. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +7 -16
  73. package/dist/modules/charts/runtime/features/charts/Editor/AdvancedConfigPanel/index.vue +1 -1
  74. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/Field.vue +19 -9
  75. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +7 -77
  76. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue +1 -1
  77. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/csvHelpers.d.ts +1 -1
  78. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +16 -8
  79. package/dist/modules/charts/runtime/features/charts/Editor/NumberFormatEditor/index.vue +23 -7
  80. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +5 -6
  81. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +1 -1
  82. package/dist/modules/charts/runtime/helpers/index.d.ts +2 -1
  83. package/dist/modules/charts/runtime/helpers/index.js +4 -2
  84. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
  85. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliMutationResult.graphql +3 -0
  86. package/dist/modules/drupal/index.d.mts +1 -1
  87. package/dist/modules/drupal/runtime/adapter/index.js +5 -1
  88. package/dist/modules/iframes/index.d.mts +1 -1
  89. package/dist/modules/index.d.mts +1 -1
  90. package/dist/modules/readability/index.d.mts +1 -1
  91. package/dist/modules/readability/index.mjs +2 -1
  92. package/dist/modules/table-of-contents/index.d.mts +1 -1
  93. package/dist/runtime/components/Blocks/NotImplemented/index.vue +1 -1
  94. package/dist/runtime/composables/useBlokkliRuntimeConfig.d.ts +50 -0
  95. package/dist/runtime/composables/useBlokkliRuntimeConfig.js +34 -0
  96. package/dist/runtime/editor/adapter/index.d.ts +2 -1
  97. package/dist/runtime/editor/components/Actions/Title/index.vue +1 -1
  98. package/dist/runtime/editor/components/Actions/index.vue +1 -1
  99. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
  100. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +2 -2
  101. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
  102. package/dist/runtime/editor/components/Avatar/index.vue +1 -1
  103. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +1 -1
  104. package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +1 -1
  105. package/dist/runtime/editor/components/BlockProxy/index.vue +1 -1
  106. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +1 -1
  107. package/dist/runtime/editor/components/BundleSelector/index.vue +1 -1
  108. package/dist/runtime/editor/components/ColorDropdown/index.d.vue.ts +26 -0
  109. package/dist/runtime/editor/components/ColorDropdown/index.vue +116 -0
  110. package/dist/runtime/editor/components/ColorDropdown/index.vue.d.ts +26 -0
  111. package/dist/runtime/editor/components/Dialog/index.vue +1 -1
  112. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +14 -20
  113. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +97 -52
  114. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +14 -20
  115. package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +6 -6
  116. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +30 -21
  117. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +6 -6
  118. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +19 -9
  119. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +19 -10
  120. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +19 -9
  121. package/dist/runtime/editor/components/DiffApproval/index.d.vue.ts +14 -6
  122. package/dist/runtime/editor/components/DiffApproval/index.vue +62 -35
  123. package/dist/runtime/editor/components/DiffApproval/index.vue.d.ts +14 -6
  124. package/dist/runtime/editor/components/DiffApproval/types.d.ts +32 -0
  125. package/dist/runtime/editor/components/DiffApproval/types.js +20 -0
  126. package/dist/runtime/editor/components/DiffViewer/State.vue +1 -1
  127. package/dist/runtime/editor/components/DraggableList.vue +1 -1
  128. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +6 -4
  129. package/dist/runtime/editor/components/Dropdown/index.vue +91 -31
  130. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +6 -4
  131. package/dist/runtime/editor/components/DropdownItem/index.vue +1 -1
  132. package/dist/runtime/editor/components/EditIndicator.vue +1 -1
  133. package/dist/runtime/editor/components/EditProvider.vue +2 -2
  134. package/dist/runtime/editor/components/FileDropHandler/index.vue +1 -1
  135. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
  136. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
  137. package/dist/runtime/editor/components/Form/RadioTabs/index.vue +1 -1
  138. package/dist/runtime/editor/components/Form/Search/index.d.vue.ts +1 -0
  139. package/dist/runtime/editor/components/Form/Search/index.vue +2 -2
  140. package/dist/runtime/editor/components/Form/Search/index.vue.d.ts +1 -0
  141. package/dist/runtime/editor/components/FormOverlay/index.vue +1 -1
  142. package/dist/runtime/editor/components/Icon/index.vue +1 -1
  143. package/dist/runtime/editor/components/Indicators/index.vue +31 -100
  144. package/dist/runtime/editor/components/Konami/Game/index.vue +1 -1
  145. package/dist/runtime/editor/components/Messages/index.vue +1 -1
  146. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +3 -2
  147. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +5 -4
  148. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +3 -2
  149. package/dist/runtime/editor/components/Overlay/index.vue +1 -1
  150. package/dist/runtime/editor/components/Pagination/index.vue +1 -1
  151. package/dist/runtime/editor/components/Panel/Section/index.vue +1 -1
  152. package/dist/runtime/editor/components/Panel/Tabs/index.d.vue.ts +1 -1
  153. package/dist/runtime/editor/components/Panel/Tabs/index.vue.d.ts +1 -1
  154. package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -1
  155. package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +1 -1
  156. package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +1 -1
  157. package/dist/runtime/editor/components/Popup/index.vue +1 -1
  158. package/dist/runtime/editor/components/PopupHost/index.d.vue.ts +13 -0
  159. package/dist/runtime/editor/components/PopupHost/index.vue +12 -0
  160. package/dist/runtime/editor/components/PopupHost/index.vue.d.ts +13 -0
  161. package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
  162. package/dist/runtime/editor/components/RelativeTime/index.vue +7 -13
  163. package/dist/runtime/editor/components/Resizable/index.vue +1 -1
  164. package/dist/runtime/editor/components/RichText/Editor/index.vue +1 -1
  165. package/dist/runtime/editor/components/ScaleToFit/index.vue +1 -1
  166. package/dist/runtime/editor/components/SearchOverlay/index.vue +1 -1
  167. package/dist/runtime/editor/components/SidebarFloater/index.vue +1 -1
  168. package/dist/runtime/editor/components/StatusIcon/index.vue +1 -1
  169. package/dist/runtime/editor/components/StatusIndicator/index.vue +1 -1
  170. package/dist/runtime/editor/components/SystemRequirements/index.vue +1 -1
  171. package/dist/runtime/editor/components/Tabs/index.d.vue.ts +1 -1
  172. package/dist/runtime/editor/components/Tabs/index.vue.d.ts +1 -1
  173. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +2 -1
  174. package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
  175. package/dist/runtime/editor/components/Transition/Collapse/index.vue +1 -1
  176. package/dist/runtime/editor/components/Transition/List/index.vue +1 -1
  177. package/dist/runtime/editor/components/index.d.ts +2 -0
  178. package/dist/runtime/editor/components/index.js +2 -0
  179. package/dist/runtime/editor/composables/defineViewOption.js +5 -1
  180. package/dist/runtime/editor/composables/useStickyToolbar.js +1 -4
  181. package/dist/runtime/editor/css/output.css +1 -1
  182. package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
  183. package/dist/runtime/editor/features/add-list/index.vue +1 -1
  184. package/dist/runtime/editor/features/analyze/Main.vue +15 -2
  185. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodes.vue +4 -1
  186. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +25 -16
  187. package/dist/runtime/editor/features/analyze/analyzers/defaults/validations.d.ts +10 -0
  188. package/dist/runtime/editor/features/analyze/analyzers/defaults/validations.js +39 -0
  189. package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.d.ts +5 -1
  190. package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.js +5 -0
  191. package/dist/runtime/editor/features/analyze/index.vue +1 -2
  192. package/dist/runtime/editor/features/anchors/Overlay/index.vue +11 -5
  193. package/dist/runtime/editor/features/anchors/index.vue +2 -1
  194. package/dist/runtime/editor/features/artboard/Overview/index.vue +1 -1
  195. package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
  196. package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +1 -1
  197. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
  198. package/dist/runtime/editor/features/block-transfer/index.vue +1 -1
  199. package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
  200. package/dist/runtime/editor/features/changelog/changelog.json +17 -1
  201. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +1 -1
  202. package/dist/runtime/editor/features/comments/AddForm/index.vue +1 -1
  203. package/dist/runtime/editor/features/comments/Comment/Meta/index.vue +1 -1
  204. package/dist/runtime/editor/features/comments/Comment/index.vue +1 -1
  205. package/dist/runtime/editor/features/comments/Thread/index.vue +1 -1
  206. package/dist/runtime/editor/features/complex-options/index.vue +1 -0
  207. package/dist/runtime/editor/features/debug/Main.vue +1 -1
  208. package/dist/runtime/editor/features/dev-mode/index.vue +1 -1
  209. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -1
  210. package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
  211. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +1 -1
  212. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +1 -1
  213. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +1 -5
  214. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +1 -5
  215. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  216. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +1 -1
  217. package/dist/runtime/editor/features/editable-mask/index.vue +1 -1
  218. package/dist/runtime/editor/features/entity-title/index.vue +17 -7
  219. package/dist/runtime/editor/features/help/Dialog/index.vue +1 -1
  220. package/dist/runtime/editor/features/help/Shortcuts/index.vue +1 -1
  221. package/dist/runtime/editor/features/history/List/index.vue +1 -1
  222. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +1 -1
  223. package/dist/runtime/editor/features/library/index.vue +1 -0
  224. package/dist/runtime/editor/features/media-library/index.vue +1 -1
  225. package/dist/runtime/editor/features/options/Form/Item.vue +5 -12
  226. package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +5 -4
  227. package/dist/runtime/editor/features/options/Form/Radios/index.vue +8 -5
  228. package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +5 -4
  229. package/dist/runtime/editor/features/options/Form/Text/index.d.vue.ts +4 -0
  230. package/dist/runtime/editor/features/options/Form/Text/index.vue +11 -3
  231. package/dist/runtime/editor/features/options/Form/Text/index.vue.d.ts +4 -0
  232. package/dist/runtime/editor/features/options/index.vue +1 -1
  233. package/dist/runtime/editor/features/publish/Dialog/Item.vue +4 -7
  234. package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +1 -1
  235. package/dist/runtime/editor/features/publish/Dialog/Violations.d.vue.ts +12 -0
  236. package/dist/runtime/editor/features/publish/Dialog/Violations.vue +117 -0
  237. package/dist/runtime/editor/features/publish/Dialog/Violations.vue.d.ts +12 -0
  238. package/dist/runtime/editor/features/publish/Dialog/index.vue +61 -24
  239. package/dist/runtime/editor/features/publish/index.vue +2 -4
  240. package/dist/runtime/editor/features/publish/types.d.ts +0 -4
  241. package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +1 -0
  242. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +1 -1
  243. package/dist/runtime/editor/features/search/index.vue +1 -1
  244. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
  245. package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +1 -1
  246. package/dist/runtime/editor/features/settings/index.vue +1 -1
  247. package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -1
  248. package/dist/runtime/editor/features/structure/index.vue +1 -1
  249. package/dist/runtime/editor/features/templates/DialogManageTemplates/Item.vue +1 -0
  250. package/dist/runtime/editor/features/templates/DialogManageTemplates/index.vue +1 -1
  251. package/dist/runtime/editor/features/theme/index.vue +1 -1
  252. package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +1 -1
  253. package/dist/runtime/editor/features/tour/Overlay/index.vue +1 -1
  254. package/dist/runtime/editor/features/transform/Dialog/index.vue +1 -1
  255. package/dist/runtime/editor/features/translations/SelectionTable/index.vue +1 -1
  256. package/dist/runtime/editor/features/workspace/index.vue +1 -1
  257. package/dist/runtime/editor/helpers/color/index.d.ts +7 -0
  258. package/dist/runtime/editor/helpers/color/index.js +14 -0
  259. package/dist/runtime/editor/helpers/diff/index.d.ts +98 -0
  260. package/dist/runtime/editor/helpers/diff/index.js +262 -0
  261. package/dist/runtime/editor/helpers/injections.d.ts +11 -0
  262. package/dist/runtime/editor/helpers/injections.js +1 -0
  263. package/dist/runtime/editor/helpers/options/index.d.ts +2 -0
  264. package/dist/runtime/editor/helpers/options/index.js +21 -0
  265. package/dist/runtime/editor/plugins/BlockIndicator/index.d.vue.ts +24 -1
  266. package/dist/runtime/editor/plugins/BlockIndicator/index.vue +17 -7
  267. package/dist/runtime/editor/plugins/BlockIndicator/index.vue.d.ts +24 -1
  268. package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +1 -0
  269. package/dist/runtime/editor/plugins/ItemAction/index.vue +1 -1
  270. package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +1 -0
  271. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  272. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  273. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
  274. package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
  275. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
  276. package/dist/runtime/editor/plugins/ToolbarButton/index.vue +1 -1
  277. package/dist/runtime/editor/providers/analyze.js +5 -2
  278. package/dist/runtime/editor/providers/animation.d.ts +2 -0
  279. package/dist/runtime/editor/providers/config.d.ts +3 -1
  280. package/dist/runtime/editor/providers/config.js +46 -15
  281. package/dist/runtime/editor/providers/definition.d.ts +4 -3
  282. package/dist/runtime/editor/providers/definition.js +10 -2
  283. package/dist/runtime/editor/providers/plugin.d.ts +1 -0
  284. package/dist/runtime/editor/providers/state.d.ts +21 -0
  285. package/dist/runtime/editor/providers/state.js +10 -0
  286. package/dist/runtime/editor/translations/de.json +9 -4
  287. package/dist/runtime/editor/translations/fr.json +4 -4
  288. package/dist/runtime/editor/translations/gsw_CH.json +9 -4
  289. package/dist/runtime/editor/translations/it.json +4 -4
  290. package/dist/runtime/editor/types/state.d.ts +7 -0
  291. package/dist/runtime/editor/types/ui.d.ts +1 -0
  292. package/dist/runtime/helpers/colors.d.ts +39 -0
  293. package/dist/runtime/helpers/colors.js +28 -0
  294. package/dist/runtime/types/colors.d.ts +11 -0
  295. package/dist/shared/{editor.D28NbXr3.d.mts → editor.BDyiQvbV.d.mts} +434 -406
  296. package/dist/shared/{editor.Gu7mgJ5Q.mjs → editor.BGemL1Oh.mjs} +146 -146
  297. package/dist/types.d.mts +1 -1
  298. package/package.json +74 -82
  299. package/dist/runtime/editor/features/validations/Overlay/Item.d.vue.ts +0 -7
  300. package/dist/runtime/editor/features/validations/Overlay/Item.vue +0 -36
  301. package/dist/runtime/editor/features/validations/Overlay/Item.vue.d.ts +0 -7
  302. package/dist/runtime/editor/features/validations/Overlay/index.d.vue.ts +0 -7
  303. package/dist/runtime/editor/features/validations/Overlay/index.vue +0 -115
  304. package/dist/runtime/editor/features/validations/Overlay/index.vue.d.ts +0 -7
  305. package/dist/runtime/editor/features/validations/SidebarItem/index.d.vue.ts +0 -10
  306. package/dist/runtime/editor/features/validations/SidebarItem/index.vue +0 -41
  307. package/dist/runtime/editor/features/validations/SidebarItem/index.vue.d.ts +0 -10
  308. package/dist/runtime/editor/features/validations/index.d.vue.ts +0 -3
  309. package/dist/runtime/editor/features/validations/index.vue +0 -91
  310. package/dist/runtime/editor/features/validations/index.vue.d.ts +0 -3
  311. package/dist/runtime/editor/types/config.d.ts +0 -5
  312. /package/dist/runtime/{editor/types/config.js → types/colors.js} +0 -0
@@ -1,3 +1,4 @@
1
+ export type DefinitionString = string | Record<string, string>;
1
2
  type DefinitionOptionText = {
2
3
  /**
3
4
  * The option type.
@@ -10,13 +11,17 @@ type DefinitionOptionText = {
10
11
  /**
11
12
  * The label displayed in the editor.
12
13
  */
13
- label: string;
14
+ label: DefinitionString;
14
15
  /**
15
16
  * Optional description providing additional context.
16
17
  *
17
18
  * Displayed below the option label in the editor.
18
19
  */
19
- description?: string;
20
+ description?: DefinitionString;
21
+ /**
22
+ * The placeholder.
23
+ */
24
+ placeholder?: DefinitionString;
20
25
  /**
21
26
  * The HTML input type.
22
27
  *
@@ -38,13 +43,13 @@ type DefinitionOptionNumberBase = {
38
43
  /**
39
44
  * The label displayed in the editor.
40
45
  */
41
- label: string;
46
+ label: DefinitionString;
42
47
  /**
43
48
  * Optional description providing additional context.
44
49
  *
45
50
  * Displayed below the option label in the editor.
46
51
  */
47
- description?: string;
52
+ description?: DefinitionString;
48
53
  /**
49
54
  * Minimum allowed value.
50
55
  *
@@ -93,13 +98,13 @@ type DefinitionOptionRange = {
93
98
  /**
94
99
  * The label displayed in the editor.
95
100
  */
96
- label: string;
101
+ label: DefinitionString;
97
102
  /**
98
103
  * Optional description providing additional context.
99
104
  *
100
105
  * Displayed below the option label in the editor.
101
106
  */
102
- description?: string;
107
+ description?: DefinitionString;
103
108
  /**
104
109
  * Minimum allowed value.
105
110
  */
@@ -127,13 +132,13 @@ type DefinitionOptionDateTimeLocal = {
127
132
  /**
128
133
  * The label displayed in the editor.
129
134
  */
130
- label: string;
135
+ label: DefinitionString;
131
136
  /**
132
137
  * Optional description providing additional context.
133
138
  *
134
139
  * Displayed below the option label in the editor.
135
140
  */
136
- description?: string;
141
+ description?: DefinitionString;
137
142
  /**
138
143
  * The default value as an ISO 8601 datetime string.
139
144
  *
@@ -167,13 +172,13 @@ type DefinitionOptionCheckbox = {
167
172
  /**
168
173
  * The label displayed in the editor.
169
174
  */
170
- label: string;
175
+ label: DefinitionString;
171
176
  /**
172
177
  * Optional description providing additional context.
173
178
  *
174
179
  * Displayed below the option label in the editor.
175
180
  */
176
- description?: string;
181
+ description?: DefinitionString;
177
182
  /**
178
183
  * Optional group name for organizing options.
179
184
  *
@@ -195,13 +200,13 @@ type DefinitionOptionColor = {
195
200
  /**
196
201
  * The label displayed in the editor.
197
202
  */
198
- label: string;
203
+ label: DefinitionString;
199
204
  /**
200
205
  * Optional description providing additional context.
201
206
  *
202
207
  * Displayed below the option label in the editor.
203
208
  */
204
- description?: string;
209
+ description?: DefinitionString;
205
210
  /**
206
211
  * Optional group name for organizing options.
207
212
  *
@@ -217,13 +222,13 @@ type DefinitionOptionCheckboxes = {
217
222
  /**
218
223
  * The label displayed in the editor.
219
224
  */
220
- label: string;
225
+ label: DefinitionString;
221
226
  /**
222
227
  * Optional description providing additional context.
223
228
  *
224
229
  * Displayed below the option label in the editor.
225
230
  */
226
- description?: string;
231
+ description?: DefinitionString;
227
232
  /**
228
233
  * The default values.
229
234
  */
@@ -233,7 +238,7 @@ type DefinitionOptionCheckboxes = {
233
238
  *
234
239
  * Key is the option value, value is the display label.
235
240
  */
236
- options: Record<string, string>;
241
+ options: Record<string, DefinitionString>;
237
242
  /**
238
243
  * Optional group name for organizing options.
239
244
  *
@@ -251,11 +256,11 @@ type DefinitionOptionRadiosGridOption = {
251
256
  /**
252
257
  * The label displayed for this option.
253
258
  */
254
- label: string;
259
+ label: DefinitionString;
255
260
  /**
256
261
  * Optional description providing additional context for this option.
257
262
  */
258
- description?: string;
263
+ description?: DefinitionString;
259
264
  };
260
265
  type DefinitionOptionRadiosGrid = {
261
266
  /**
@@ -285,11 +290,11 @@ type DefinitionOptionRadiosColorsOption = {
285
290
  /**
286
291
  * The label displayed for this option.
287
292
  */
288
- label: string;
293
+ label: DefinitionString;
289
294
  /**
290
295
  * Optional description providing additional context for this option.
291
296
  */
292
- description?: string;
297
+ description?: DefinitionString;
293
298
  };
294
299
  type DefinitionOptionRadiosColors = {
295
300
  /**
@@ -317,8 +322,8 @@ type DefinitionOptionRadiosRadios = {
317
322
  * label and optional description.
318
323
  */
319
324
  options: Record<string, string | {
320
- label: string;
321
- description?: string;
325
+ label: DefinitionString;
326
+ description?: DefinitionString;
322
327
  }>;
323
328
  };
324
329
  type DefinitionOptionRadiosIconsOptionBase<Icon extends string = string> = {
@@ -331,11 +336,11 @@ type DefinitionOptionRadiosIconsOptionBase<Icon extends string = string> = {
331
336
  /**
332
337
  * The label displayed for this option.
333
338
  */
334
- label: string;
339
+ label: DefinitionString;
335
340
  /**
336
341
  * Optional description providing additional context for this option.
337
342
  */
338
- description?: string;
343
+ description?: DefinitionString;
339
344
  };
340
345
  type DefinitionOptionRadiosIconsBase<Icon extends string = string> = {
341
346
  /**
@@ -357,13 +362,13 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
357
362
  /**
358
363
  * The label displayed in the editor.
359
364
  */
360
- label: string;
365
+ label: DefinitionString;
361
366
  /**
362
367
  * Optional description providing additional context.
363
368
  *
364
369
  * Displayed below the option label in the editor.
365
370
  */
366
- description?: string;
371
+ description?: DefinitionString;
367
372
  /**
368
373
  * The default value.
369
374
  *
@@ -379,10 +384,10 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
379
384
  } & (DefinitionOptionRadiosColors | DefinitionOptionRadiosGrid | DefinitionOptionRadiosRadios | DefinitionOptionRadiosIconsBase<Icon>);
380
385
  type DefinitionOptionJsonBase<DataType extends string = string> = {
381
386
  type: 'json';
382
- label: string;
387
+ label: DefinitionString;
383
388
  default: string;
384
389
  dataType?: DataType;
385
- description?: string;
390
+ description?: DefinitionString;
386
391
  group?: string;
387
392
  };
388
393
  export type BlockOptionDefinitionBase<Icon extends string = string, DataType extends string = string> = DefinitionOptionJsonBase<DataType> | DefinitionOptionColor | DefinitionOptionCheckbox | DefinitionOptionCheckboxes | DefinitionOptionRadiosBase<Icon> | DefinitionOptionText | DefinitionOptionRange | DefinitionOptionNumber | DefinitionOptionDateTimeLocal;
@@ -1,4 +1,20 @@
1
+ /**
2
+ * A color option declared at build time.
3
+ *
4
+ * Two shapes:
5
+ * - A flat color with a single hex value.
6
+ * - A ramped color with a map of shades and an explicit `mainShade` that
7
+ * identifies which shade is the canonical/base swatch.
8
+ *
9
+ * For ramped colors, a chart can reference the base via the bare color id
10
+ * (e.g. `red`) or any specific shade via the compound id `red.<shade>` (e.g.
11
+ * `red.300`).
12
+ */
1
13
  export type ColorOption = {
14
+ label: string;
2
15
  hex: string;
16
+ } | {
3
17
  label: string;
18
+ shades: Record<string, string>;
19
+ mainShade: string;
4
20
  };
package/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NuxtModule } from 'nuxt/schema';
2
- import { M as ModuleOptions } from './shared/editor.D28NbXr3.mjs';
3
- export { a as ModuleHooks } from './shared/editor.D28NbXr3.mjs';
2
+ import { M as ModuleOptions } from './shared/editor.BDyiQvbV.mjs';
3
+ export { a as ModuleHooks } from './shared/editor.BDyiQvbV.mjs';
4
4
  import 'consola';
5
5
  import '../dist/global/types/definitions.js';
6
6
  import '../dist/global/types/theme.js';
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
3
  "configKey": "blokkli",
4
- "version": "2.0.0-alpha.62",
4
+ "version": "2.0.0-alpha.64",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.15.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -5,7 +5,7 @@ import MagicString from 'magic-string';
5
5
  import { walk } from 'estree-walker-ts';
6
6
  import { pathToFileURL } from 'node:url';
7
7
  import { parseURL, parseQuery } from 'ufo';
8
- import { C as Collector, a as CollectedFile, c as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.Gu7mgJ5Q.mjs';
8
+ import { C as Collector, a as CollectedFile, c as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.BGemL1Oh.mjs';
9
9
  import { dirname, resolve, relative } from 'pathe';
10
10
  import micromatch from 'micromatch';
11
11
  import { hash } from 'ohash';
@@ -19,7 +19,7 @@ import 'typescript';
19
19
  import 'oxc-walker';
20
20
 
21
21
  const name = "@blokkli/editor";
22
- const version = "2.0.0-alpha.62";
22
+ const version = "2.0.0-alpha.64";
23
23
 
24
24
  function validateOption(optionKey, option, icons) {
25
25
  const errors = [];
@@ -1008,6 +1008,95 @@ class FileCache {
1008
1008
  }
1009
1009
  }
1010
1010
 
1011
+ const HEX_COLOR_REGEX = /^#(?:[\da-f]{3}|[\da-f]{6})$/i;
1012
+ const VALID_ID_REGEX = /^[a-z_$][\w$]*$/i;
1013
+ function isHex(value) {
1014
+ return typeof value === "string" && HEX_COLOR_REGEX.test(value);
1015
+ }
1016
+ function isNonEmptyString(value) {
1017
+ return typeof value === "string" && value.length > 0;
1018
+ }
1019
+ function hasShades(option) {
1020
+ return "shades" in option && !!option.shades && typeof option.shades === "object";
1021
+ }
1022
+ function validateColorOption(colorId, option) {
1023
+ const errors = [];
1024
+ if (!VALID_ID_REGEX.test(colorId)) {
1025
+ errors.push({
1026
+ message: `Color id "${colorId}" is not a valid JavaScript identifier (must start with a letter, underscore or $, followed by letters, digits, underscores or $). Color ids may not contain "." \u2014 that character is reserved for shade-qualified ids (e.g. "red.300").`,
1027
+ optionKey: colorId
1028
+ });
1029
+ }
1030
+ if (!isNonEmptyString(option.label)) {
1031
+ errors.push({
1032
+ message: `Option "${colorId}" is missing a non-empty "label".`,
1033
+ optionKey: colorId
1034
+ });
1035
+ }
1036
+ if (hasShades(option)) {
1037
+ const shadeKeys = Object.keys(option.shades);
1038
+ if (shadeKeys.length === 0) {
1039
+ errors.push({
1040
+ message: `Option "${colorId}" declares an empty "shades" object. Either omit "shades" or declare at least one shade.`,
1041
+ optionKey: colorId
1042
+ });
1043
+ }
1044
+ for (const shadeKey of shadeKeys) {
1045
+ const shadeValue = option.shades[shadeKey];
1046
+ if (!isHex(shadeValue)) {
1047
+ errors.push({
1048
+ message: `Option "${colorId}" shade "${shadeKey}" has value "${shadeValue}" which is not a valid hex color (expected format: #RRGGBB or #RGB)`,
1049
+ optionKey: colorId
1050
+ });
1051
+ }
1052
+ }
1053
+ if (!isNonEmptyString(option.mainShade)) {
1054
+ errors.push({
1055
+ message: `Option "${colorId}" declares "shades" but is missing "mainShade".`,
1056
+ optionKey: colorId
1057
+ });
1058
+ } else if (!shadeKeys.includes(option.mainShade)) {
1059
+ errors.push({
1060
+ message: `Option "${colorId}" mainShade "${option.mainShade}" is not a key of shades (available: ${shadeKeys.map((k) => `"${k}"`).join(", ")})`,
1061
+ optionKey: colorId
1062
+ });
1063
+ }
1064
+ if ("hex" in option) {
1065
+ errors.push({
1066
+ message: `Option "${colorId}" declares both "hex" and "shades". Use one or the other: shaded colors derive their base hex from "shades[mainShade]".`,
1067
+ optionKey: colorId
1068
+ });
1069
+ }
1070
+ } else {
1071
+ const hex = option.hex;
1072
+ if (hex === void 0) {
1073
+ errors.push({
1074
+ message: `Option "${colorId}": "hex" is required when "shades" is not provided.`,
1075
+ optionKey: colorId
1076
+ });
1077
+ } else if (!isHex(hex)) {
1078
+ errors.push({
1079
+ message: `Option "${colorId}" has hex value "${hex}" which is not a valid hex color (expected format: #RRGGBB or #RGB)`,
1080
+ optionKey: colorId
1081
+ });
1082
+ }
1083
+ }
1084
+ return errors;
1085
+ }
1086
+ function validateColorOptions(colorOptions) {
1087
+ if (!colorOptions) {
1088
+ return [];
1089
+ }
1090
+ const errors = [];
1091
+ for (const [colorId, option] of Object.entries(colorOptions)) {
1092
+ if (!option || typeof option !== "object") {
1093
+ continue;
1094
+ }
1095
+ errors.push(...validateColorOption(colorId, option));
1096
+ }
1097
+ return errors;
1098
+ }
1099
+
1011
1100
  const defaultColorOptions = {
1012
1101
  blue: { hex: "#3b82f6", label: "Blue" },
1013
1102
  red: { hex: "#ef4444", label: "Red" },
@@ -1109,6 +1198,11 @@ class ModuleHelper {
1109
1198
  resolvers;
1110
1199
  fileCache;
1111
1200
  options;
1201
+ /**
1202
+ * npm packages to pre-bundle via Vite's optimizeDeps, collected from the core
1203
+ * module and enabled sub-modules. Flushed by {@link applyBuildConfig}.
1204
+ */
1205
+ packageDependencies = /* @__PURE__ */ new Set();
1112
1206
  isDev;
1113
1207
  isModuleBuild;
1114
1208
  isPrepare;
@@ -1165,6 +1259,43 @@ class ModuleHelper {
1165
1259
  from: this.resolvers.module.resolve("./runtime/composables/" + name)
1166
1260
  });
1167
1261
  }
1262
+ /**
1263
+ * Register npm packages that the editor imports at runtime so Vite
1264
+ * pre-bundles them.
1265
+ *
1266
+ * Without this, Vite discovers a dependency lazily on first import (often via
1267
+ * a dynamic `import()`) and triggers a full page reload to re-optimize. The
1268
+ * core module declares its own dependencies; optional modules (agent, charts,
1269
+ * …) declare theirs only when enabled, so projects that don't use a module
1270
+ * don't pre-bundle its dependencies.
1271
+ *
1272
+ * Collected here and flushed to the Vite config by {@link applyBuildConfig},
1273
+ * which the core module calls once all modules have run their setup.
1274
+ *
1275
+ * @param names - Bare package specifiers (e.g. 'echarts', '@tiptap/core').
1276
+ */
1277
+ addPackageDependency(...names) {
1278
+ for (const name of names) {
1279
+ this.packageDependencies.add(name);
1280
+ }
1281
+ }
1282
+ /**
1283
+ * Apply collected build configuration to the Nuxt/Vite config.
1284
+ *
1285
+ * Called once by the core module after every module's setup has run, so it
1286
+ * sees the full set of {@link addPackageDependency} registrations.
1287
+ */
1288
+ applyBuildConfig() {
1289
+ this.nuxt.options.vite.optimizeDeps ??= {};
1290
+ const include = this.nuxt.options.vite.optimizeDeps.include ??= [];
1291
+ const exclude = this.nuxt.options.vite.optimizeDeps.exclude ?? [];
1292
+ for (const name of this.packageDependencies) {
1293
+ if (include.includes(name) || exclude.includes(name)) {
1294
+ continue;
1295
+ }
1296
+ include.push(name);
1297
+ }
1298
+ }
1168
1299
  addAlias(name, path) {
1169
1300
  this.nuxt.options.alias[name] = path;
1170
1301
  this.nuxt.options.nitro.typescript ||= {};
@@ -1221,9 +1352,10 @@ class ModuleHelper {
1221
1352
  return bundle;
1222
1353
  }
1223
1354
  validate(icons) {
1224
- const errors = validateOptions(this.options.globalOptions, icons);
1225
- if (errors.length > 0) {
1226
- const lines = errors.map((error) => {
1355
+ let hasErrors = false;
1356
+ const optionErrors = validateOptions(this.options.globalOptions, icons);
1357
+ if (optionErrors.length > 0) {
1358
+ const lines = optionErrors.map((error) => {
1227
1359
  const prefix = error.optionKey ? ` Option "${error.optionKey}": ` : " ";
1228
1360
  return prefix + error.message;
1229
1361
  });
@@ -1231,9 +1363,21 @@ class ModuleHelper {
1231
1363
  `bl\xF6kkli global options validation errors:
1232
1364
  ${lines.join("\n")}`
1233
1365
  );
1234
- return true;
1366
+ hasErrors = true;
1235
1367
  }
1236
- return false;
1368
+ const colorErrors = validateColorOptions(this.options.colorOptions);
1369
+ if (colorErrors.length > 0) {
1370
+ const lines = colorErrors.map((error) => {
1371
+ const prefix = error.optionKey ? ` Option "${error.optionKey}": ` : " ";
1372
+ return prefix + error.message;
1373
+ });
1374
+ this.logger.error(
1375
+ `bl\xF6kkli colorOptions validation errors:
1376
+ ${lines.join("\n")}`
1377
+ );
1378
+ hasErrors = true;
1379
+ }
1380
+ return hasErrors;
1237
1381
  }
1238
1382
  }
1239
1383
 
@@ -2121,12 +2265,20 @@ function mangleClassExpression(expr) {
2121
2265
  }
2122
2266
  return result;
2123
2267
  }
2268
+ const CLASS_BEARING_PROPS = ["button-class", "background-class"];
2124
2269
  function mangleTemplateAndScript(code) {
2125
2270
  let result = code;
2126
2271
  result = result.replace(
2127
2272
  /(?<![-:.])\bclass="([^"]*)"/g,
2128
2273
  (_match, value) => `class="${mangleClassString(value)}"`
2129
2274
  );
2275
+ for (const prop of CLASS_BEARING_PROPS) {
2276
+ const staticAttr = new RegExp(`(?<![:.])\\b${prop}="([^"]*)"`, "g");
2277
+ result = result.replace(
2278
+ staticAttr,
2279
+ (_match, value) => `${prop}="${mangleClassString(value)}"`
2280
+ );
2281
+ }
2130
2282
  result = result.replace(
2131
2283
  /\btw\(\s*(['"])([\s\S]*?)\1\s*\)/g,
2132
2284
  (_match, quote, value) => `tw(${quote}${mangleClassString(value)}${quote})`
@@ -2135,6 +2287,13 @@ function mangleTemplateAndScript(code) {
2135
2287
  /(?::|v-bind:)class="([^"]*)"/g,
2136
2288
  (_match, expr) => `:class="${mangleClassExpression(expr)}"`
2137
2289
  );
2290
+ for (const prop of CLASS_BEARING_PROPS) {
2291
+ const boundAttr = new RegExp(`(:|v-bind:)${prop}="([^"]*)"`, "g");
2292
+ result = result.replace(
2293
+ boundAttr,
2294
+ (_match, prefix, expr) => `${prefix}${prop}="${mangleClassExpression(expr)}"`
2295
+ );
2296
+ }
2138
2297
  return result;
2139
2298
  }
2140
2299
  function withTailwindConfig(cssContent, tailwindConfigPath) {
@@ -2279,6 +2438,19 @@ ${moduleCSS}
2279
2438
  { dependencies: ["module-css"] }
2280
2439
  );
2281
2440
 
2441
+ function buildColorPalette(ctx) {
2442
+ const palette = [];
2443
+ for (const [id, option] of Object.entries(
2444
+ ctx.helper.options.colorOptions || {}
2445
+ )) {
2446
+ if ("shades" in option) {
2447
+ palette.push(`${id}.${option.mainShade}`);
2448
+ } else {
2449
+ palette.push(id);
2450
+ }
2451
+ }
2452
+ return palette;
2453
+ }
2282
2454
  function mapVars(ctx) {
2283
2455
  return {
2284
2456
  itemEntityType: JSON.stringify(
@@ -2289,7 +2461,8 @@ function mapVars(ctx) {
2289
2461
  ),
2290
2462
  fragmentBlockBundle: JSON.stringify(
2291
2463
  ctx.helper.options.fragmentBlockBundle ?? "blokkli_fragment"
2292
- )
2464
+ ),
2465
+ colorPalette: JSON.stringify(buildColorPalette(ctx))
2293
2466
  };
2294
2467
  }
2295
2468
  const config = defineCodeTemplate(
@@ -2302,6 +2475,8 @@ export const itemEntityType = ${vars.itemEntityType}
2302
2475
  export const fromLibraryBlockBundle = ${vars.fromLibraryBlockBundle}
2303
2476
 
2304
2477
  export const fragmentBlockBundle = ${vars.fragmentBlockBundle}
2478
+
2479
+ export const colorPalette = ${vars.colorPalette}
2305
2480
  `;
2306
2481
  },
2307
2482
  (ctx) => {
@@ -2314,6 +2489,15 @@ export declare const itemEntityType: ${vars.itemEntityType}
2314
2489
 
2315
2490
  export declare const fromLibraryBlockBundle: ${vars.fromLibraryBlockBundle}
2316
2491
  export declare const fragmentBlockBundle: ${vars.fragmentBlockBundle}
2492
+
2493
+ /**
2494
+ * Ordered list of canonical default color ids \u2014 one per declared family,
2495
+ * in declaration order. Flat colors appear as bare ids, ramped colors as
2496
+ * \`<id>.<mainShade>\`. Runtime consumers cycle through this to assign
2497
+ * default colors (e.g. dynamic chart series); the runtime composable also
2498
+ * walks it as a fallback cascade when a requested id can't be resolved.
2499
+ */
2500
+ export declare const colorPalette: string[]
2317
2501
  `;
2318
2502
  }
2319
2503
  );
@@ -3176,6 +3360,10 @@ import type { InterfaceLanguage } from '#blokkli-build/translations'
3176
3360
 
3177
3361
  export type ValidColorOption = ${validColorOptions}
3178
3362
 
3363
+ export type GeneratedColorOption =
3364
+ | { label: string; hex: string }
3365
+ | { label: string; shades: Record<string, string>; mainShade: string }
3366
+
3179
3367
  /**
3180
3368
  * Whether the app uses a custom theme.
3181
3369
  */
@@ -3189,7 +3377,7 @@ export declare const themes: Record<string, Theme>
3189
3377
  /**
3190
3378
  * The available color options.
3191
3379
  */
3192
- export declare const colorOptions: Record<ValidColorOption, { hex: string; label: string }>
3380
+ export declare const colorOptions: Record<ValidColorOption, GeneratedColorOption>
3193
3381
 
3194
3382
  /**
3195
3383
  * The default theme.
@@ -3913,6 +4101,39 @@ const optionsSchema = withHelper((helper) => {
3913
4101
  }
3914
4102
  return defineFileTemplate(fileName, (ctx) => {
3915
4103
  const globalOptions = ctx.helper.options.globalOptions || {};
4104
+ const defaultLanguage = ctx.helper.options.defaultLanguage || "en";
4105
+ const normalizeDefinitionString = (value) => {
4106
+ if (typeof value === "string") {
4107
+ return { [defaultLanguage]: value };
4108
+ }
4109
+ return value;
4110
+ };
4111
+ const normalizeOption = (option) => {
4112
+ if (!option || typeof option !== "object") {
4113
+ return option;
4114
+ }
4115
+ const result = { ...option };
4116
+ if ("label" in result) {
4117
+ result.label = normalizeDefinitionString(result.label);
4118
+ }
4119
+ if ("description" in result) {
4120
+ result.description = normalizeDefinitionString(result.description);
4121
+ }
4122
+ if (result.options && typeof result.options === "object") {
4123
+ const normalizedOptions = {};
4124
+ for (const [key, value] of Object.entries(result.options)) {
4125
+ if (result.type === "checkboxes") {
4126
+ normalizedOptions[key] = normalizeDefinitionString(value);
4127
+ } else if (typeof value === "string") {
4128
+ normalizedOptions[key] = { label: { [defaultLanguage]: value } };
4129
+ } else {
4130
+ normalizedOptions[key] = normalizeOption(value);
4131
+ }
4132
+ }
4133
+ result.options = normalizedOptions;
4134
+ }
4135
+ return result;
4136
+ };
3916
4137
  const blocks = [...ctx.blocks.files.values()];
3917
4138
  const schema = blocks.reduce((acc, v) => {
3918
4139
  if (v.definition && isBlock(v.definition)) {
@@ -3928,6 +4149,12 @@ const optionsSchema = withHelper((helper) => {
3928
4149
  }
3929
4150
  return acc;
3930
4151
  }, {});
4152
+ for (const bundle of Object.keys(schema)) {
4153
+ const options = schema[bundle];
4154
+ for (const key of Object.keys(options)) {
4155
+ options[key] = normalizeOption(options[key]);
4156
+ }
4157
+ }
3931
4158
  const sorted = sortObjectKeys(schema);
3932
4159
  return JSON.stringify(sorted, null, 2);
3933
4160
  });
@@ -4366,14 +4593,21 @@ const module$1 = defineNuxtModule({
4366
4593
  import.meta.url,
4367
4594
  moduleOptions
4368
4595
  );
4369
- const colorOptions = Object.entries(
4596
+ const colorOptions = {};
4597
+ for (const [id, option] of Object.entries(
4370
4598
  helper.options.colorOptions || {}
4371
- ).reduce((acc, entry) => {
4372
- acc[entry[0]] = entry[1].hex;
4373
- return acc;
4374
- }, {});
4599
+ )) {
4600
+ if ("shades" in option) {
4601
+ colorOptions[id] = option.shades[option.mainShade];
4602
+ for (const [shadeId, hex] of Object.entries(option.shades)) {
4603
+ colorOptions[`${id}.${shadeId}`] = hex;
4604
+ }
4605
+ } else {
4606
+ colorOptions[id] = option.hex;
4607
+ }
4608
+ }
4375
4609
  nuxt.options.appConfig.blokkli = {
4376
- // @ts-expect-error The module config type defined a generic Record type, but in userland, this type will automatically contain the actual color keys as properties.
4610
+ // @ts-expect-error generic type vs runtime derived type.
4377
4611
  colorOptions
4378
4612
  };
4379
4613
  const theme = new ThemeData(helper);
@@ -4437,9 +4671,31 @@ const module$1 = defineNuxtModule({
4437
4671
  const moduleDir = import.meta.url;
4438
4672
  const resolver = createResolver(moduleDir);
4439
4673
  nuxt.options.build.transpile.push(resolver.resolve("runtime"));
4440
- nuxt.options.vite.optimizeDeps ??= {};
4441
- nuxt.options.vite.optimizeDeps.include ??= [];
4442
- nuxt.options.vite.optimizeDeps.include.push("papaparse", "pofile");
4674
+ helper.addPackageDependency(
4675
+ "@floating-ui/dom",
4676
+ "@tiptap/core",
4677
+ "@tiptap/extension-emoji",
4678
+ "@tiptap/extension-mention",
4679
+ "@tiptap/extension-task-item",
4680
+ "@tiptap/extension-task-list",
4681
+ "@tiptap/starter-kit",
4682
+ "@tiptap/vue-3",
4683
+ "@vue/devtools-core",
4684
+ "@vue/devtools-kit",
4685
+ "axe-core",
4686
+ // CJS
4687
+ "fzf",
4688
+ "get-video-id",
4689
+ "html-diff-ts",
4690
+ "mitt",
4691
+ "papaparse",
4692
+ // CJS
4693
+ "pofile",
4694
+ // CJS
4695
+ "qrcode.vue",
4696
+ "twgl.js"
4697
+ );
4698
+ helper.applyBuildConfig();
4443
4699
  helper.addComponent("BlokkliField");
4444
4700
  helper.addComponent("BlokkliEditable");
4445
4701
  helper.addComponent("BlokkliProvider");
@@ -4450,6 +4706,7 @@ const module$1 = defineNuxtModule({
4450
4706
  helper.addComposable("defineBlokkliProvider");
4451
4707
  helper.addComposable("useBlokkli");
4452
4708
  helper.addComposable("useBlokkliHelper");
4709
+ helper.addComposable("useBlokkliRuntimeConfig");
4453
4710
  helper.addAlias(
4454
4711
  "#blokkli/analyzer",
4455
4712
  resolver.resolve("runtime/editor/features/analyze/analyzers")
@@ -1,4 +1,4 @@
1
- import { B as BlokkliModule } from '../../shared/editor.D28NbXr3.mjs';
1
+ import { B as BlokkliModule } from '../../shared/editor.BDyiQvbV.mjs';
2
2
  import 'nuxt/schema';
3
3
  import 'consola';
4
4
  import '../../../dist/global/types/definitions.js';