@blokkli/editor 2.0.0-alpha.39 → 2.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +15 -105
- package/dist/modules/agent/index.d.mts +1 -0
- package/dist/modules/agent/index.mjs +81 -8
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +8 -3
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +108 -13
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +7 -6
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.d.vue.ts +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +12 -10
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue.d.ts +2 -2
- package/dist/modules/agent/runtime/app/features/agent/index.vue +29 -5
- package/dist/modules/agent/runtime/app/helpers/pageStructure.js +7 -17
- package/dist/modules/agent/runtime/app/prompts/fixReadability.d.ts +2 -0
- package/dist/modules/agent/runtime/app/prompts/fixReadability.js +49 -0
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.js +24 -15
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.d.vue.ts +46 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +739 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue.d.ts +46 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Details/index.d.vue.ts +6 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Details/index.vue +38 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Details/index.vue.d.ts +6 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +38 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +115 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +3 -5
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +4 -7
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +10 -17
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +17 -70
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/helpers.d.ts +38 -10
- package/dist/modules/agent/runtime/app/tools/helpers.js +90 -27
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue +66 -84
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +8 -1
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.js +21 -14
- package/dist/modules/agent/runtime/app/types/index.d.ts +41 -0
- package/dist/modules/agent/runtime/server/Session.d.ts +8 -1
- package/dist/modules/agent/runtime/server/Session.js +154 -6
- package/dist/modules/agent/runtime/server/agent.js +5 -1
- package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +31 -51
- package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.js +45 -4
- package/dist/modules/agent/runtime/server/providers/anthropic.js +2 -1
- package/dist/modules/agent/runtime/server/providers/openai.js +2 -1
- package/dist/modules/agent/runtime/server/providers/types.d.ts +2 -0
- package/dist/modules/agent/runtime/server/route.d.ts +2 -0
- package/dist/modules/agent/runtime/server/route.js +40 -0
- package/dist/modules/agent/runtime/server/routing.d.ts +18 -0
- package/dist/modules/agent/runtime/server/routing.js +111 -0
- package/dist/modules/agent/runtime/server/skills/types.d.ts +10 -0
- package/dist/modules/agent/runtime/server/stream.d.ts +2 -0
- package/dist/modules/agent/runtime/server/stream.js +190 -0
- package/dist/modules/agent/runtime/server/streamParser.d.ts +85 -0
- package/dist/modules/agent/runtime/server/streamParser.js +227 -0
- package/dist/modules/agent/runtime/server/templates/defineStreamTemplate.d.ts +21 -0
- package/dist/modules/agent/runtime/server/templates/defineStreamTemplate.js +3 -0
- package/dist/modules/agent/runtime/server/templates/definitions/fixReadability.d.ts +26 -0
- package/dist/modules/agent/runtime/server/templates/definitions/fixReadability.js +84 -0
- package/dist/modules/agent/runtime/server/templates/definitions/generateContent.d.ts +6 -0
- package/dist/modules/agent/runtime/server/templates/definitions/generateContent.js +29 -0
- package/dist/modules/agent/runtime/server/templates/definitions/rewrite.d.ts +5 -0
- package/dist/modules/agent/runtime/server/templates/definitions/rewrite.js +14 -0
- package/dist/modules/agent/runtime/server/templates/definitions/translate.d.ts +5 -0
- package/dist/modules/agent/runtime/server/templates/definitions/translate.js +23 -0
- package/dist/modules/agent/runtime/server/templates/index.d.ts +37 -0
- package/dist/modules/agent/runtime/server/templates/index.js +25 -0
- package/dist/modules/agent/runtime/server/templates/types.d.ts +17 -0
- package/dist/modules/agent/runtime/server/templates/types.js +0 -0
- package/dist/modules/agent/runtime/server/templates/utils.d.ts +5 -0
- package/dist/modules/agent/runtime/server/templates/utils.js +69 -0
- package/dist/modules/agent/runtime/shared/types.d.ts +18 -0
- package/dist/modules/agent/runtime/shared/types.js +16 -1
- package/dist/runtime/components/BlokkliItem.d.vue.ts +1 -1
- package/dist/runtime/components/BlokkliItem.vue +34 -3
- package/dist/runtime/components/BlokkliItem.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Actions/index.vue +2 -2
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +23 -2
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +19 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +106 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +19 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +22 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +50 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +22 -0
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +24 -0
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +113 -0
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +24 -0
- package/dist/runtime/editor/components/DiffApproval/index.d.vue.ts +19 -0
- package/dist/runtime/editor/components/DiffApproval/index.vue +158 -0
- package/dist/runtime/editor/components/DiffApproval/index.vue.d.ts +19 -0
- package/dist/runtime/editor/components/DiffApproval/types.d.ts +7 -0
- package/dist/runtime/editor/components/DiffApproval/types.js +0 -0
- package/dist/runtime/editor/components/DiffViewer/DiffValue.vue +2 -11
- package/dist/runtime/editor/components/DraggableList.vue +1 -1
- package/dist/runtime/editor/components/EditProvider.vue +18 -1
- package/dist/runtime/editor/components/ShortcutIndicator/index.d.vue.ts +2 -2
- package/dist/runtime/editor/components/ShortcutIndicator/index.vue +27 -33
- package/dist/runtime/editor/components/ShortcutIndicator/index.vue.d.ts +2 -2
- package/dist/runtime/editor/components/index.d.ts +2 -1
- package/dist/runtime/editor/components/index.js +2 -0
- package/dist/runtime/editor/composables/useEditableFieldOverride.d.ts +2 -0
- package/dist/runtime/editor/composables/useEditableFieldOverride.js +21 -15
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +3 -0
- package/dist/runtime/editor/features/add-list/index.vue +1 -0
- package/dist/runtime/editor/features/analyze/Main.vue +1 -1
- package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.d.ts +7 -2
- package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.js +6 -1
- package/dist/runtime/editor/features/analyze/analyzers/readability.js +52 -222
- package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +2 -2
- package/dist/runtime/editor/features/analyze/readability/adapterTypes.d.ts +9 -0
- package/dist/runtime/editor/features/analyze/readability/adapterTypes.js +0 -0
- package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +6 -0
- package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +200 -0
- package/dist/runtime/editor/features/analyze/readability/chunkHtml.d.ts +15 -0
- package/dist/runtime/editor/features/analyze/readability/chunkHtml.js +97 -0
- package/dist/runtime/editor/features/analyze/readability/types.d.ts +72 -0
- package/dist/runtime/editor/features/analyze/readability/types.js +0 -0
- package/dist/runtime/editor/features/artboard/Renderer.vue +9 -5
- package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/index.vue +1 -1
- package/dist/runtime/editor/features/hover/index.vue +1 -1
- package/dist/runtime/editor/features/options/index.vue +1 -1
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
- package/dist/runtime/editor/features/selection/index.vue +2 -2
- package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -3
- package/dist/runtime/editor/helpers/diff/index.d.ts +11 -0
- package/dist/runtime/editor/helpers/diff/index.js +227 -0
- package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
- package/dist/runtime/editor/providers/analyze.d.ts +2 -1
- package/dist/runtime/editor/providers/analyze.js +6 -3
- package/dist/runtime/editor/providers/directive.js +1 -0
- package/dist/runtime/editor/providers/fieldValue.d.ts +54 -0
- package/dist/runtime/editor/providers/fieldValue.js +126 -0
- package/dist/runtime/editor/providers/fieldValueAdapterTypes.d.ts +13 -0
- package/dist/runtime/editor/providers/fieldValueAdapterTypes.js +0 -0
- package/dist/runtime/editor/providers/readability.d.ts +23 -0
- package/dist/runtime/editor/providers/readability.js +130 -0
- package/dist/runtime/editor/providers/state.d.ts +16 -0
- package/dist/runtime/editor/providers/state.js +19 -1
- package/dist/runtime/editor/providers/ui.d.ts +7 -0
- package/dist/runtime/editor/providers/ui.js +7 -1
- package/dist/runtime/editor/translations/de.json +80 -8
- package/dist/runtime/editor/translations/fr.json +80 -8
- package/dist/runtime/editor/translations/gsw_CH.json +80 -8
- package/dist/runtime/editor/translations/it.json +80 -8
- package/dist/runtime/editor/types/app.d.ts +4 -0
- package/dist/shared/editor.9vf8ZnOp.mjs +288 -0
- package/package.json +2 -2
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Item.d.vue.ts +0 -22
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Item.vue +0 -95
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Item.vue.d.ts +0 -22
- package/dist/shared/editor.BFIzNSQM.mjs +0 -146
|
@@ -75,6 +75,18 @@
|
|
|
75
75
|
"source": "<p>This shows the list of available blocks that can be placed. Add a block by dragging the icon into the page.</p><p>When an existing block is selected, some blocks may be greyed out. This indicates which blocks can be placed inside or after the selected block.</p>",
|
|
76
76
|
"translation": "<p>Do gsehsch d'Lischt vo allne verfüegbare Blöck wo chönne drzuegfüegt wärde. Zieh s'Symbol in d'Sitte zum e Block drzuefüege.</p><p>Wenn e Block usgwählt isch, sin gwüssi Blöck uusggruet. Das zeigt aa, welchi Blöck in oder noch däm usgwählte Block chönne platziert wärde.</p>"
|
|
77
77
|
},
|
|
78
|
+
"agentPromptReadabilityLabel": {
|
|
79
|
+
"source": "Fix readability...",
|
|
80
|
+
"translation": ""
|
|
81
|
+
},
|
|
82
|
+
"agentPromptReadabilityPrompt": {
|
|
83
|
+
"source": "The readability issues have already been analyzed and the fix has been applied. Do not call any more tools. Just very briefly confirm that you are done.",
|
|
84
|
+
"translation": ""
|
|
85
|
+
},
|
|
86
|
+
"agentPromptReadabilityUserPrompt": {
|
|
87
|
+
"source": "Fix the readability of the selected paragraphs.",
|
|
88
|
+
"translation": ""
|
|
89
|
+
},
|
|
78
90
|
"agentSidebarTooltipLabel": {
|
|
79
91
|
"source": "@name (AI-Assistant)",
|
|
80
92
|
"translation": ""
|
|
@@ -143,6 +155,34 @@
|
|
|
143
155
|
"source": "Analyzing content...",
|
|
144
156
|
"translation": "Inhalt wird analysiert..."
|
|
145
157
|
},
|
|
158
|
+
"aiAgentApprovalAccept": {
|
|
159
|
+
"source": "Accept",
|
|
160
|
+
"translation": ""
|
|
161
|
+
},
|
|
162
|
+
"aiAgentApprovalAccepted": {
|
|
163
|
+
"source": "Accepted",
|
|
164
|
+
"translation": ""
|
|
165
|
+
},
|
|
166
|
+
"aiAgentApprovalHint": {
|
|
167
|
+
"source": "Review changes and accept or reject them individually. Tab/Arrow keys: navigate, Space/Enter: accept/reject.",
|
|
168
|
+
"translation": ""
|
|
169
|
+
},
|
|
170
|
+
"aiAgentApprovalNextChange": {
|
|
171
|
+
"source": "Next change",
|
|
172
|
+
"translation": ""
|
|
173
|
+
},
|
|
174
|
+
"aiAgentApprovalPrevChange": {
|
|
175
|
+
"source": "Previous change",
|
|
176
|
+
"translation": ""
|
|
177
|
+
},
|
|
178
|
+
"aiAgentApprovalRejected": {
|
|
179
|
+
"source": "Rejected",
|
|
180
|
+
"translation": ""
|
|
181
|
+
},
|
|
182
|
+
"aiAgentApprovalToggle": {
|
|
183
|
+
"source": "Toggle approval",
|
|
184
|
+
"translation": ""
|
|
185
|
+
},
|
|
146
186
|
"aiAgentApprove": {
|
|
147
187
|
"source": "Approve",
|
|
148
188
|
"translation": ""
|
|
@@ -191,10 +231,6 @@
|
|
|
191
231
|
"source": "Rewriting multiple texts...",
|
|
192
232
|
"translation": ""
|
|
193
233
|
},
|
|
194
|
-
"aiAgentBatchRewriteTitle": {
|
|
195
|
-
"source": "Rewrite @count fields",
|
|
196
|
-
"translation": ""
|
|
197
|
-
},
|
|
198
234
|
"aiAgentBlockNotFound": {
|
|
199
235
|
"source": "Block not found",
|
|
200
236
|
"translation": ""
|
|
@@ -235,6 +271,38 @@
|
|
|
235
271
|
"source": "Plan: @label",
|
|
236
272
|
"translation": ""
|
|
237
273
|
},
|
|
274
|
+
"aiAgentDelegateRewriteCancelled": {
|
|
275
|
+
"source": "Rewriting cancelled",
|
|
276
|
+
"translation": ""
|
|
277
|
+
},
|
|
278
|
+
"aiAgentDelegateRewriteChecking": {
|
|
279
|
+
"source": "Checking readability...",
|
|
280
|
+
"translation": ""
|
|
281
|
+
},
|
|
282
|
+
"aiAgentDelegateRewriteError": {
|
|
283
|
+
"source": "Rewriting failed",
|
|
284
|
+
"translation": ""
|
|
285
|
+
},
|
|
286
|
+
"aiAgentDelegateRewriteFailed": {
|
|
287
|
+
"source": "Rewriting failed",
|
|
288
|
+
"translation": ""
|
|
289
|
+
},
|
|
290
|
+
"aiAgentDelegateRewriteNoChanges": {
|
|
291
|
+
"source": "No changes detected",
|
|
292
|
+
"translation": ""
|
|
293
|
+
},
|
|
294
|
+
"aiAgentDelegateRewriteRetrying": {
|
|
295
|
+
"source": "Retrying @count fields (attempt @attempt)...",
|
|
296
|
+
"translation": ""
|
|
297
|
+
},
|
|
298
|
+
"aiAgentDelegateRewriteRunning": {
|
|
299
|
+
"source": "Rewriting texts...",
|
|
300
|
+
"translation": ""
|
|
301
|
+
},
|
|
302
|
+
"aiAgentDelegateRewriteStreaming": {
|
|
303
|
+
"source": "Rewriting @count fields...",
|
|
304
|
+
"translation": ""
|
|
305
|
+
},
|
|
238
306
|
"aiAgentDeleteBlockDone": {
|
|
239
307
|
"source": "Deleted @bundle",
|
|
240
308
|
"translation": ""
|
|
@@ -267,6 +335,10 @@
|
|
|
267
335
|
"source": "Connection lost. Reconnecting...",
|
|
268
336
|
"translation": ""
|
|
269
337
|
},
|
|
338
|
+
"aiAgentDropFiles": {
|
|
339
|
+
"source": "Drop files to attach",
|
|
340
|
+
"translation": ""
|
|
341
|
+
},
|
|
270
342
|
"aiAgentDuplicateBlockDone": {
|
|
271
343
|
"source": "Duplicated @bundle",
|
|
272
344
|
"translation": ""
|
|
@@ -795,10 +867,6 @@
|
|
|
795
867
|
"source": "Analyze the content of your page",
|
|
796
868
|
"translation": "Dr Inhalt vo dinere Sitte analysiere"
|
|
797
869
|
},
|
|
798
|
-
"analyzerReadabiliyAverageSentenceLength": {
|
|
799
|
-
"source": "Average sentence length @length → split sentences.",
|
|
800
|
-
"translation": "Durchschnittlichi Satzlängi @length → Sätz ufdrennen."
|
|
801
|
-
},
|
|
802
870
|
"analyzerReadabiliyDescription": {
|
|
803
871
|
"source": "Avoid texts that are hard to read.",
|
|
804
872
|
"translation": "Vermiid Teggscht wo schwär z'läse sin."
|
|
@@ -2143,6 +2211,10 @@
|
|
|
2143
2211
|
"source": "Hide interaction layers",
|
|
2144
2212
|
"translation": ""
|
|
2145
2213
|
},
|
|
2214
|
+
"keyboardSpace": {
|
|
2215
|
+
"source": "Space",
|
|
2216
|
+
"translation": ""
|
|
2217
|
+
},
|
|
2146
2218
|
"libraryAdd": {
|
|
2147
2219
|
"source": "Add to library...",
|
|
2148
2220
|
"translation": "Zur Bibliothek drzuefüege"
|
|
@@ -75,6 +75,18 @@
|
|
|
75
75
|
"source": "<p>This shows the list of available blocks that can be placed. Add a block by dragging the icon into the page.</p><p>When an existing block is selected, some blocks may be greyed out. This indicates which blocks can be placed inside or after the selected block.</p>",
|
|
76
76
|
"translation": ""
|
|
77
77
|
},
|
|
78
|
+
"agentPromptReadabilityLabel": {
|
|
79
|
+
"source": "Fix readability...",
|
|
80
|
+
"translation": ""
|
|
81
|
+
},
|
|
82
|
+
"agentPromptReadabilityPrompt": {
|
|
83
|
+
"source": "The readability issues have already been analyzed and the fix has been applied. Do not call any more tools. Just very briefly confirm that you are done.",
|
|
84
|
+
"translation": ""
|
|
85
|
+
},
|
|
86
|
+
"agentPromptReadabilityUserPrompt": {
|
|
87
|
+
"source": "Fix the readability of the selected paragraphs.",
|
|
88
|
+
"translation": ""
|
|
89
|
+
},
|
|
78
90
|
"agentSidebarTooltipLabel": {
|
|
79
91
|
"source": "@name (AI-Assistant)",
|
|
80
92
|
"translation": ""
|
|
@@ -143,6 +155,34 @@
|
|
|
143
155
|
"source": "Analyzing content...",
|
|
144
156
|
"translation": "Analisi del contenuto..."
|
|
145
157
|
},
|
|
158
|
+
"aiAgentApprovalAccept": {
|
|
159
|
+
"source": "Accept",
|
|
160
|
+
"translation": ""
|
|
161
|
+
},
|
|
162
|
+
"aiAgentApprovalAccepted": {
|
|
163
|
+
"source": "Accepted",
|
|
164
|
+
"translation": ""
|
|
165
|
+
},
|
|
166
|
+
"aiAgentApprovalHint": {
|
|
167
|
+
"source": "Review changes and accept or reject them individually. Tab/Arrow keys: navigate, Space/Enter: accept/reject.",
|
|
168
|
+
"translation": ""
|
|
169
|
+
},
|
|
170
|
+
"aiAgentApprovalNextChange": {
|
|
171
|
+
"source": "Next change",
|
|
172
|
+
"translation": ""
|
|
173
|
+
},
|
|
174
|
+
"aiAgentApprovalPrevChange": {
|
|
175
|
+
"source": "Previous change",
|
|
176
|
+
"translation": ""
|
|
177
|
+
},
|
|
178
|
+
"aiAgentApprovalRejected": {
|
|
179
|
+
"source": "Rejected",
|
|
180
|
+
"translation": ""
|
|
181
|
+
},
|
|
182
|
+
"aiAgentApprovalToggle": {
|
|
183
|
+
"source": "Toggle approval",
|
|
184
|
+
"translation": ""
|
|
185
|
+
},
|
|
146
186
|
"aiAgentApprove": {
|
|
147
187
|
"source": "Approve",
|
|
148
188
|
"translation": ""
|
|
@@ -191,10 +231,6 @@
|
|
|
191
231
|
"source": "Rewriting multiple texts...",
|
|
192
232
|
"translation": ""
|
|
193
233
|
},
|
|
194
|
-
"aiAgentBatchRewriteTitle": {
|
|
195
|
-
"source": "Rewrite @count fields",
|
|
196
|
-
"translation": ""
|
|
197
|
-
},
|
|
198
234
|
"aiAgentBlockNotFound": {
|
|
199
235
|
"source": "Block not found",
|
|
200
236
|
"translation": ""
|
|
@@ -235,6 +271,38 @@
|
|
|
235
271
|
"source": "Plan: @label",
|
|
236
272
|
"translation": ""
|
|
237
273
|
},
|
|
274
|
+
"aiAgentDelegateRewriteCancelled": {
|
|
275
|
+
"source": "Rewriting cancelled",
|
|
276
|
+
"translation": ""
|
|
277
|
+
},
|
|
278
|
+
"aiAgentDelegateRewriteChecking": {
|
|
279
|
+
"source": "Checking readability...",
|
|
280
|
+
"translation": ""
|
|
281
|
+
},
|
|
282
|
+
"aiAgentDelegateRewriteError": {
|
|
283
|
+
"source": "Rewriting failed",
|
|
284
|
+
"translation": ""
|
|
285
|
+
},
|
|
286
|
+
"aiAgentDelegateRewriteFailed": {
|
|
287
|
+
"source": "Rewriting failed",
|
|
288
|
+
"translation": ""
|
|
289
|
+
},
|
|
290
|
+
"aiAgentDelegateRewriteNoChanges": {
|
|
291
|
+
"source": "No changes detected",
|
|
292
|
+
"translation": ""
|
|
293
|
+
},
|
|
294
|
+
"aiAgentDelegateRewriteRetrying": {
|
|
295
|
+
"source": "Retrying @count fields (attempt @attempt)...",
|
|
296
|
+
"translation": ""
|
|
297
|
+
},
|
|
298
|
+
"aiAgentDelegateRewriteRunning": {
|
|
299
|
+
"source": "Rewriting texts...",
|
|
300
|
+
"translation": ""
|
|
301
|
+
},
|
|
302
|
+
"aiAgentDelegateRewriteStreaming": {
|
|
303
|
+
"source": "Rewriting @count fields...",
|
|
304
|
+
"translation": ""
|
|
305
|
+
},
|
|
238
306
|
"aiAgentDeleteBlockDone": {
|
|
239
307
|
"source": "Deleted @bundle",
|
|
240
308
|
"translation": ""
|
|
@@ -267,6 +335,10 @@
|
|
|
267
335
|
"source": "Connection lost. Reconnecting...",
|
|
268
336
|
"translation": ""
|
|
269
337
|
},
|
|
338
|
+
"aiAgentDropFiles": {
|
|
339
|
+
"source": "Drop files to attach",
|
|
340
|
+
"translation": ""
|
|
341
|
+
},
|
|
270
342
|
"aiAgentDuplicateBlockDone": {
|
|
271
343
|
"source": "Duplicated @bundle",
|
|
272
344
|
"translation": ""
|
|
@@ -795,10 +867,6 @@
|
|
|
795
867
|
"source": "Analyze the content of your page",
|
|
796
868
|
"translation": ""
|
|
797
869
|
},
|
|
798
|
-
"analyzerReadabiliyAverageSentenceLength": {
|
|
799
|
-
"source": "Average sentence length @length → split sentences.",
|
|
800
|
-
"translation": ""
|
|
801
|
-
},
|
|
802
870
|
"analyzerReadabiliyDescription": {
|
|
803
871
|
"source": "Avoid texts that are hard to read.",
|
|
804
872
|
"translation": ""
|
|
@@ -2143,6 +2211,10 @@
|
|
|
2143
2211
|
"source": "Hide interaction layers",
|
|
2144
2212
|
"translation": ""
|
|
2145
2213
|
},
|
|
2214
|
+
"keyboardSpace": {
|
|
2215
|
+
"source": "Space",
|
|
2216
|
+
"translation": ""
|
|
2217
|
+
},
|
|
2146
2218
|
"libraryAdd": {
|
|
2147
2219
|
"source": "Add to library...",
|
|
2148
2220
|
"translation": "Aggiungi alla biblioteca"
|
|
@@ -27,6 +27,8 @@ import type { DefinitionProvider } from '../providers/definition.js';
|
|
|
27
27
|
import type { PermissionsProvider } from '../providers/permissions.js';
|
|
28
28
|
import type { AdaptersProvider } from '../providers/adapters.js';
|
|
29
29
|
import type { AnalyzeProvider } from '../providers/analyze.js';
|
|
30
|
+
import type { ReadabilityProvider } from '../providers/readability.js';
|
|
31
|
+
import type { FieldValueProvider } from '../providers/fieldValue.js';
|
|
30
32
|
import type { DragDropProvider } from '../providers/dragdrop.js';
|
|
31
33
|
export interface BlokkliApp {
|
|
32
34
|
/**
|
|
@@ -64,5 +66,7 @@ export interface BlokkliApp {
|
|
|
64
66
|
icons: IconsProvider;
|
|
65
67
|
permissions: PermissionsProvider;
|
|
66
68
|
analyze: AnalyzeProvider;
|
|
69
|
+
readability: ReadabilityProvider;
|
|
70
|
+
fieldValue: FieldValueProvider;
|
|
67
71
|
dragdrop: DragDropProvider;
|
|
68
72
|
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
import { parseAndWalk } from 'oxc-walker';
|
|
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
|
+
function sortObjectKeys(obj) {
|
|
150
|
+
if (Array.isArray(obj)) {
|
|
151
|
+
return obj.map(sortObjectKeys);
|
|
152
|
+
} else if (obj && typeof obj === "object") {
|
|
153
|
+
const sortedObj = {};
|
|
154
|
+
const keys = Object.keys(obj).sort();
|
|
155
|
+
for (const key of keys) {
|
|
156
|
+
sortedObj[key] = sortObjectKeys(obj[key]);
|
|
157
|
+
}
|
|
158
|
+
return sortedObj;
|
|
159
|
+
}
|
|
160
|
+
return obj;
|
|
161
|
+
}
|
|
162
|
+
function toValidVariableName(input) {
|
|
163
|
+
let result = input.replace(/\W/g, "_");
|
|
164
|
+
if (/^\d/.test(result)) {
|
|
165
|
+
result = "_" + result;
|
|
166
|
+
}
|
|
167
|
+
if (result === "") {
|
|
168
|
+
result = "_empty";
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
function parseTsObject(tsObjectStr) {
|
|
173
|
+
const source = `(${tsObjectStr})`;
|
|
174
|
+
const result = ts.transpileModule(source, {
|
|
175
|
+
compilerOptions: {
|
|
176
|
+
target: ts.ScriptTarget.ESNext,
|
|
177
|
+
module: ts.ModuleKind.None,
|
|
178
|
+
removeComments: true
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
const jsCode = result.outputText.trim();
|
|
182
|
+
const createObj = new Function(`return ${jsCode}`);
|
|
183
|
+
const object = createObj();
|
|
184
|
+
return { object, source: jsCode };
|
|
185
|
+
}
|
|
186
|
+
function falsy(value) {
|
|
187
|
+
return value !== null && value !== void 0;
|
|
188
|
+
}
|
|
189
|
+
const SFC_SCRIPT_RE = /<script(?<attrs>[^>]*)>(?<content>[\s\S]*?)<\/script[^>]*>/gi;
|
|
190
|
+
function extractScriptContent(sfc) {
|
|
191
|
+
const contents = [];
|
|
192
|
+
let hasMatch = false;
|
|
193
|
+
for (const match of sfc.matchAll(SFC_SCRIPT_RE)) {
|
|
194
|
+
hasMatch = true;
|
|
195
|
+
if (match?.groups?.content) {
|
|
196
|
+
contents.push({
|
|
197
|
+
loader: match.groups.attrs && /[tj]sx/.test(match.groups.attrs) ? "tsx" : "ts",
|
|
198
|
+
code: match.groups.content.trim()
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (!hasMatch) {
|
|
203
|
+
contents.push({
|
|
204
|
+
loader: "ts",
|
|
205
|
+
code: sfc.trim()
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return contents;
|
|
209
|
+
}
|
|
210
|
+
function extractObjectLiteral(fileContents, composables) {
|
|
211
|
+
if (!composables.some((composable) => fileContents.includes(composable))) {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
const scripts = extractScriptContent(fileContents);
|
|
215
|
+
for (const script of scripts) {
|
|
216
|
+
try {
|
|
217
|
+
let result;
|
|
218
|
+
const filename = script.loader === "tsx" ? "temp.tsx" : "temp.ts";
|
|
219
|
+
parseAndWalk(script.code, filename, {
|
|
220
|
+
parseOptions: {
|
|
221
|
+
range: true
|
|
222
|
+
},
|
|
223
|
+
enter(node) {
|
|
224
|
+
if (result) return;
|
|
225
|
+
if (node.type === "CallExpression" && node.callee.type === "Identifier" && composables.includes(node.callee.name)) {
|
|
226
|
+
for (const arg of node.arguments) {
|
|
227
|
+
if (arg.type === "ObjectExpression" && arg.range) {
|
|
228
|
+
result = script.code.substring(arg.range[0], arg.range[1]);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
if (result) {
|
|
236
|
+
return result;
|
|
237
|
+
}
|
|
238
|
+
} catch (error) {
|
|
239
|
+
console.log(error);
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return void 0;
|
|
244
|
+
}
|
|
245
|
+
function extractStringProperty(fileContents, composables, propertyName) {
|
|
246
|
+
if (!composables.some((composable) => fileContents.includes(composable))) {
|
|
247
|
+
return void 0;
|
|
248
|
+
}
|
|
249
|
+
const scripts = extractScriptContent(fileContents);
|
|
250
|
+
for (const script of scripts) {
|
|
251
|
+
try {
|
|
252
|
+
let result;
|
|
253
|
+
const filename = script.loader === "tsx" ? "temp.tsx" : "temp.ts";
|
|
254
|
+
parseAndWalk(script.code, filename, {
|
|
255
|
+
parseOptions: {
|
|
256
|
+
range: true
|
|
257
|
+
},
|
|
258
|
+
enter(node) {
|
|
259
|
+
if (result) return;
|
|
260
|
+
if (node.type === "CallExpression" && node.callee.type === "Identifier" && composables.includes(node.callee.name)) {
|
|
261
|
+
for (const arg of node.arguments) {
|
|
262
|
+
if (arg.type === "ObjectExpression") {
|
|
263
|
+
for (const prop of arg.properties) {
|
|
264
|
+
if (prop.type === "Property" && prop.key.type === "Identifier" && prop.key.name === propertyName && prop.value.type === "Literal" && typeof prop.value.value === "string") {
|
|
265
|
+
result = prop.value.value;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
if (result) {
|
|
276
|
+
return result;
|
|
277
|
+
}
|
|
278
|
+
} catch {
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return void 0;
|
|
283
|
+
}
|
|
284
|
+
function onlyUnique(value, index, self) {
|
|
285
|
+
return self.indexOf(value) === index;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export { Collector as C, CollectedFile as a, extractObjectLiteral as b, extractStringProperty as e, falsy as f, onlyUnique as o, parseTsObject as p, sortObjectKeys as s, toValidVariableName as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blokkli/editor",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.40",
|
|
4
4
|
"description": "Interactive page building experience for Nuxt",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@material-symbols/svg-600": "0.40.2",
|
|
106
106
|
"@nuxt/kit": "^4.2.2",
|
|
107
107
|
"apexcharts": "^5.4.0",
|
|
108
|
-
"artboard-deluxe": "^0.1.
|
|
108
|
+
"artboard-deluxe": "^0.1.5",
|
|
109
109
|
"estree-walker-ts": "^1.1.0",
|
|
110
110
|
"fzf": "^0.5.2",
|
|
111
111
|
"get-video-id": "^4.1.7",
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { DiffDisplayMode } from '#blokkli/editor/components/DiffViewer/DiffDisplay/index.vue';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
uuid: string;
|
|
4
|
-
fieldName: string;
|
|
5
|
-
fieldLabel: string;
|
|
6
|
-
newValue: string;
|
|
7
|
-
diffMode: DiffDisplayMode;
|
|
8
|
-
};
|
|
9
|
-
type __VLS_ModelProps = {
|
|
10
|
-
'selected'?: boolean;
|
|
11
|
-
'reason'?: string;
|
|
12
|
-
};
|
|
13
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
14
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
-
"update:selected": (value: boolean) => any;
|
|
16
|
-
"update:reason": (value: string) => any;
|
|
17
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
-
"onUpdate:selected"?: ((value: boolean) => any) | undefined;
|
|
19
|
-
"onUpdate:reason"?: ((value: string) => any) | undefined;
|
|
20
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
-
declare const _default: typeof __VLS_export;
|
|
22
|
-
export default _default;
|