@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
|
@@ -6,11 +6,13 @@ const NOOP_OVERRIDE = {
|
|
|
6
6
|
fieldType: "plain",
|
|
7
7
|
setValue() {
|
|
8
8
|
},
|
|
9
|
+
setDiffHtml() {
|
|
10
|
+
},
|
|
9
11
|
restore() {
|
|
10
12
|
}
|
|
11
13
|
};
|
|
12
14
|
export function useEditableFieldOverride(fieldName, host) {
|
|
13
|
-
const { eventBus, state, types, definitions, directive } = useBlokkli();
|
|
15
|
+
const { eventBus, state, types, definitions, directive, fieldValue } = useBlokkli();
|
|
14
16
|
const el = directive.findEditableElement(fieldName, host);
|
|
15
17
|
if (!el) {
|
|
16
18
|
return NOOP_OVERRIDE;
|
|
@@ -53,22 +55,11 @@ export function useEditableFieldOverride(fieldName, host) {
|
|
|
53
55
|
const mutatedItemPropsKey = providerDefinition ? "HOST" : host.uuid;
|
|
54
56
|
const usesMutatedProps = !!matchingProp;
|
|
55
57
|
const usesDirectDom = !isComponent && !matchingProp;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
originalValue = editableData?.getValue ? editableData.getValue() : "";
|
|
59
|
-
} else if (usesMutatedProps && matchingProp) {
|
|
60
|
-
if (providerDefinition) {
|
|
61
|
-
originalValue = state.mutatedEntity.value[matchingProp] || "";
|
|
62
|
-
} else {
|
|
63
|
-
originalValue = state.getFieldListItem(host.uuid)?.props?.[matchingProp] ?? "";
|
|
64
|
-
}
|
|
65
|
-
} else if (isMarkup) {
|
|
66
|
-
originalValue = element.innerHTML;
|
|
67
|
-
} else {
|
|
68
|
-
originalValue = element.textContent || "";
|
|
69
|
-
}
|
|
58
|
+
const readResult = fieldValue.readFieldValue(fieldName, host);
|
|
59
|
+
const originalValue = readResult?.value ?? "";
|
|
70
60
|
const originalMutatedProp = usesMutatedProps && matchingProp ? state.mutatedItemProps[mutatedItemPropsKey]?.[matchingProp] : void 0;
|
|
71
61
|
function setValue(value) {
|
|
62
|
+
element.removeAttribute("data-bk-diff-active");
|
|
72
63
|
if (usesMutatedProps && matchingProp) {
|
|
73
64
|
if (!state.mutatedItemProps[mutatedItemPropsKey]) {
|
|
74
65
|
state.mutatedItemProps[mutatedItemPropsKey] = {};
|
|
@@ -90,7 +81,14 @@ export function useEditableFieldOverride(fieldName, host) {
|
|
|
90
81
|
});
|
|
91
82
|
}
|
|
92
83
|
}
|
|
84
|
+
function setDiffHtml(html) {
|
|
85
|
+
element.setAttribute("data-bk-diff-active", "");
|
|
86
|
+
element.innerHTML = html;
|
|
87
|
+
state.markDirty(host.uuid);
|
|
88
|
+
}
|
|
93
89
|
function restore() {
|
|
90
|
+
const wasDiffActive = element.hasAttribute("data-bk-diff-active");
|
|
91
|
+
element.removeAttribute("data-bk-diff-active");
|
|
94
92
|
if (usesMutatedProps && matchingProp) {
|
|
95
93
|
const propsObj = state.mutatedItemProps[mutatedItemPropsKey];
|
|
96
94
|
if (propsObj) {
|
|
@@ -103,6 +101,13 @@ export function useEditableFieldOverride(fieldName, host) {
|
|
|
103
101
|
propsObj[matchingProp] = originalMutatedProp;
|
|
104
102
|
}
|
|
105
103
|
}
|
|
104
|
+
if (wasDiffActive) {
|
|
105
|
+
if (isMarkup) {
|
|
106
|
+
element.innerHTML = originalValue;
|
|
107
|
+
} else {
|
|
108
|
+
element.textContent = originalValue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
106
111
|
}
|
|
107
112
|
if (usesDirectDom) {
|
|
108
113
|
if (isMarkup) {
|
|
@@ -124,6 +129,7 @@ export function useEditableFieldOverride(fieldName, host) {
|
|
|
124
129
|
originalValue,
|
|
125
130
|
fieldType,
|
|
126
131
|
setValue,
|
|
132
|
+
setDiffHtml,
|
|
127
133
|
restore
|
|
128
134
|
};
|
|
129
135
|
}
|