@blokkli/editor 2.0.0-alpha.53 → 2.0.0-alpha.55
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/global/constants/index.d.ts +1 -1
- package/dist/global/constants/index.js +1 -1
- package/dist/global/types/features.d.ts +5 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +28 -35
- package/dist/modules/agent/index.mjs +46 -29
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +2 -1
- package/dist/modules/agent/runtime/app/features/agent/Container.d.vue.ts +19 -0
- package/dist/modules/agent/runtime/app/features/agent/Container.vue +195 -0
- package/dist/modules/agent/runtime/app/features/agent/Container.vue.d.ts +19 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +18 -164
- package/dist/modules/agent/runtime/app/features/agent/types.d.ts +9 -0
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +7 -3
- package/dist/modules/agent/runtime/app/helpers/index.js +9 -3
- package/dist/modules/agent/runtime/app/prompts/fixReadability.js +51 -44
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -1
- package/dist/modules/agent/runtime/app/tools/check_readability/index.js +1 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +6 -1
- package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +1 -0
- package/dist/modules/agent/runtime/app/types/index.d.ts +12 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +34 -18
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +7 -0
- package/dist/modules/drupal/graphql/features/droppable-field-items.graphql +22 -0
- package/dist/modules/drupal/graphql/features/import-existing.graphql +0 -25
- package/dist/modules/drupal/graphql/features/workspace.graphql +9 -2
- package/dist/modules/drupal/graphql/mutations/update_droppable_field.graphql +21 -0
- package/dist/modules/drupal/index.mjs +6 -2
- package/dist/modules/drupal/runtime/adapter/index.js +75 -39
- package/dist/modules/readability/index.d.mts +11 -0
- package/dist/modules/readability/index.mjs +17 -0
- package/dist/modules/readability/runtime/adapter-extension.d.ts +2 -0
- package/dist/modules/readability/runtime/adapter-extension.js +5 -0
- package/dist/modules/readability/runtime/analyzers/builtin.d.ts +10 -0
- package/dist/modules/readability/runtime/analyzers/builtin.js +340 -0
- package/dist/runtime/components/BlokkliEditable.vue +10 -90
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/BlokkliProvider.vue +11 -5
- package/dist/runtime/composables/defineBlokkli.js +3 -1
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +2 -3
- package/dist/runtime/editor/components/Actions/index.vue +1 -1
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +41 -6
- package/dist/runtime/editor/components/AppMenu/Inner.d.vue.ts +7 -0
- package/dist/runtime/editor/components/AppMenu/Inner.vue +83 -0
- package/dist/runtime/editor/components/AppMenu/Inner.vue.d.ts +7 -0
- package/dist/runtime/editor/components/AppMenu/index.vue +5 -79
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +9 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +12 -6
- package/dist/runtime/editor/components/BlokkliEditableEdit.d.vue.ts +23 -0
- package/dist/runtime/editor/components/BlokkliEditableEdit.vue +95 -0
- package/dist/runtime/editor/components/BlokkliEditableEdit.vue.d.ts +23 -0
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.d.vue.ts +4 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +4 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue.d.ts +4 -1
- package/dist/runtime/editor/components/BundleSelector/index.vue +10 -5
- package/dist/runtime/editor/components/Dialog/index.vue +0 -77
- package/dist/runtime/editor/components/EditIndicator.d.vue.ts +1 -0
- package/dist/runtime/editor/components/EditIndicator.vue +3 -2
- package/dist/runtime/editor/components/EditIndicator.vue.d.ts +1 -0
- package/dist/runtime/editor/components/EditProvider.d.vue.ts +3 -1
- package/dist/runtime/editor/components/EditProvider.vue +13 -4
- package/dist/runtime/editor/components/EditProvider.vue.d.ts +3 -1
- package/dist/runtime/editor/components/FeaturesRenderer/index.vue +1 -4
- package/dist/runtime/editor/components/Form/Text/index.d.vue.ts +5 -0
- package/dist/runtime/editor/components/Form/Text/index.vue +10 -4
- package/dist/runtime/editor/components/Form/Text/index.vue.d.ts +5 -0
- package/dist/runtime/editor/components/FormOverlay/index.vue +0 -24
- package/dist/runtime/editor/components/GrowOnly/index.d.vue.ts +10 -0
- package/dist/runtime/editor/components/GrowOnly/index.vue +34 -0
- package/dist/runtime/editor/components/GrowOnly/index.vue.d.ts +10 -0
- package/dist/runtime/editor/components/Konami/Game/index.vue +120 -0
- package/dist/runtime/editor/components/Konami/index.vue +7 -124
- package/dist/runtime/editor/components/Loading/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigForm/Text/index.vue +1 -0
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -0
- package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +3 -1
- package/dist/runtime/editor/components/PreviewProvider.vue +6 -1
- package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +3 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/index.d.ts +11 -10
- package/dist/runtime/editor/components/index.js +32 -10
- package/dist/runtime/editor/composables/defineRenderer.d.ts +2 -2
- package/dist/runtime/editor/composables/defineRenderer.js +8 -3
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +6 -0
- package/dist/runtime/editor/features/analyze/Main.d.vue.ts +1 -0
- package/dist/runtime/editor/features/analyze/Main.vue +9 -8
- package/dist/runtime/editor/features/analyze/Main.vue.d.ts +1 -0
- package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +7 -15
- package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +4 -2
- package/dist/runtime/editor/features/analyze/analyzers/axe.js +9 -9
- package/dist/runtime/editor/features/analyze/analyzers/readability.js +7 -7
- package/dist/runtime/editor/features/analyze/index.vue +26 -26
- package/dist/runtime/editor/features/analyze/readability/types.d.ts +18 -14
- package/dist/runtime/editor/features/anchors/index.vue +6 -2
- package/dist/runtime/editor/features/artboard/Renderer.vue +3 -2
- package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +78 -0
- package/dist/runtime/editor/features/block-scheduler/index.vue +34 -89
- package/dist/runtime/editor/features/breadcrumbs/index.vue +2 -2
- package/dist/runtime/editor/features/changelog/changelog.json +8 -0
- package/dist/runtime/editor/features/changelog/index.vue +10 -8
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +152 -0
- package/dist/runtime/editor/features/clipboard/index.vue +13 -159
- package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -28
- package/dist/runtime/editor/features/command-palette/Palette/index.vue +17 -6
- package/dist/runtime/editor/features/command-palette/index.vue +7 -2
- package/dist/runtime/editor/features/comments/index.vue +6 -3
- package/dist/runtime/editor/features/debug/Main.vue +168 -0
- package/dist/runtime/editor/features/debug/Section/Features.vue +1 -2
- package/dist/runtime/editor/features/debug/index.vue +6 -170
- package/dist/runtime/editor/features/dev-mode/index.vue +2 -1
- package/dist/runtime/editor/features/diff/index.vue +6 -2
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +15 -16
- package/dist/runtime/editor/features/dragging-overlay/index.vue +4 -3
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.d.vue.ts +15 -0
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +547 -0
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue.d.ts +15 -0
- package/dist/runtime/editor/features/droppable-field-edit/index.d.vue.ts +3 -0
- package/dist/runtime/editor/features/droppable-field-edit/index.vue +231 -0
- package/dist/runtime/editor/features/droppable-field-edit/index.vue.d.ts +3 -0
- package/dist/runtime/editor/features/droppable-field-edit/types.d.ts +70 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.d.vue.ts +1 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +34 -21
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue.d.ts +1 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +6 -13
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +4 -4
- package/dist/runtime/editor/features/fragments/index.vue +9 -4
- package/dist/runtime/editor/features/help/index.vue +7 -2
- package/dist/runtime/editor/features/highlights/Renderer/index.vue +11 -17
- package/dist/runtime/editor/features/history/index.vue +3 -2
- package/dist/runtime/editor/features/hover/Renderer/index.vue +87 -36
- package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +5 -5
- package/dist/runtime/editor/features/hover/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/Item.d.vue.ts +5 -0
- package/dist/runtime/editor/features/import-existing/Dialog/Item.vue +55 -0
- package/dist/runtime/editor/features/import-existing/Dialog/Item.vue.d.ts +5 -0
- package/dist/runtime/editor/features/import-existing/Dialog/index.d.vue.ts +7 -3
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +107 -65
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue.d.ts +7 -3
- package/dist/runtime/editor/features/import-existing/index.vue +19 -6
- package/dist/runtime/editor/features/import-existing/types.d.ts +0 -11
- package/dist/runtime/editor/features/library/ReusableDialog/index.vue +7 -33
- package/dist/runtime/editor/features/library/index.vue +14 -5
- package/dist/runtime/editor/features/media-library/Library/index.vue +3 -1
- package/dist/runtime/editor/features/media-library/index.vue +9 -2
- package/dist/runtime/editor/features/media-library/types.d.ts +2 -0
- package/dist/runtime/editor/features/multi-select/Renderer/index.vue +16 -15
- package/dist/runtime/editor/features/multi-select/index.vue +9 -3
- package/dist/runtime/editor/features/options/Form/Radios/index.vue +4 -8
- package/dist/runtime/editor/features/options/index.vue +7 -2
- package/dist/runtime/editor/features/preview-grant/index.vue +8 -2
- package/dist/runtime/editor/features/publish/index.vue +3 -2
- package/dist/runtime/editor/features/referenced-entities/index.vue +7 -2
- package/dist/runtime/editor/features/responsive-preview/index.vue +13 -11
- package/dist/runtime/editor/features/search/index.vue +6 -2
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +6 -11
- package/dist/runtime/editor/features/selection/Renderer/index.vue +9 -14
- package/dist/runtime/editor/features/selection/index.vue +7 -4
- package/dist/runtime/editor/features/settings/index.vue +8 -3
- package/dist/runtime/editor/features/structure/index.vue +3 -2
- package/dist/runtime/editor/features/templates/CreateDialog/index.vue +1 -0
- package/dist/runtime/editor/features/templates/index.vue +14 -6
- package/dist/runtime/editor/features/theme/index.vue +2 -1
- package/dist/runtime/editor/features/tour/index.vue +6 -2
- package/dist/runtime/editor/features/translations/index.vue +7 -4
- package/dist/runtime/editor/features/workspace/Overlay/Item.d.vue.ts +3 -0
- package/dist/runtime/editor/features/workspace/Overlay/Item.vue +49 -0
- package/dist/runtime/editor/features/workspace/Overlay/Item.vue.d.ts +3 -0
- package/dist/runtime/editor/features/workspace/Overlay/index.vue +16 -104
- package/dist/runtime/editor/features/workspace/index.vue +6 -2
- package/dist/runtime/editor/helpers/webgl/index.d.ts +3 -2
- package/dist/runtime/editor/helpers/webgl/index.js +2 -3
- package/dist/runtime/editor/libraries/fzf.d.ts +3 -0
- package/dist/runtime/editor/libraries/fzf.js +7 -0
- package/dist/runtime/editor/libraries/twgl.d.ts +10 -0
- package/dist/runtime/editor/libraries/twgl.js +14 -0
- package/dist/runtime/editor/plugins/DebugOverlay/index.vue +3 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +39 -18
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -0
- package/dist/runtime/editor/plugins/Sidebar/index.vue +12 -4
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -0
- package/dist/runtime/editor/providers/animation.d.ts +5 -10
- package/dist/runtime/editor/providers/animation.js +10 -8
- package/dist/runtime/editor/providers/directive.d.ts +11 -0
- package/dist/runtime/editor/providers/directive.js +16 -0
- package/dist/runtime/editor/providers/features.d.ts +3 -3
- package/dist/runtime/editor/providers/features.js +1 -1
- package/dist/runtime/editor/providers/fieldValue.d.ts +27 -0
- package/dist/runtime/editor/providers/fieldValue.js +21 -1
- package/dist/runtime/editor/providers/keyboard.js +6 -3
- package/dist/runtime/editor/providers/readability.d.ts +28 -4
- package/dist/runtime/editor/providers/readability.js +30 -46
- package/dist/runtime/editor/providers/selection.d.ts +8 -0
- package/dist/runtime/editor/providers/selection.js +6 -0
- package/dist/runtime/editor/providers/texts.d.ts +1 -3
- package/dist/runtime/editor/providers/texts.js +34 -37
- package/dist/runtime/editor/providers/workspaces.d.ts +93 -0
- package/dist/runtime/editor/providers/workspaces.js +76 -0
- package/dist/runtime/editor/translations/de.json +918 -3616
- package/dist/runtime/editor/translations/fr.json +250 -3616
- package/dist/runtime/editor/translations/gsw_CH.json +918 -3616
- package/dist/runtime/editor/translations/it.json +250 -3616
- package/dist/runtime/editor/types/app.d.ts +2 -0
- package/dist/runtime/editor/types/features.d.ts +1 -1
- package/dist/runtime/editor/types/state.d.ts +7 -0
- package/dist/runtime/helpers/injections.d.ts +6 -0
- package/dist/runtime/helpers/injections.js +3 -0
- package/dist/runtime/types/definitions.d.ts +4 -0
- package/package.json +14 -4
- package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +0 -6
- package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +0 -216
- package/dist/runtime/editor/features/workspace/types.d.ts +0 -59
- /package/dist/runtime/editor/features/{workspace → droppable-field-edit}/types.js +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="tag"
|
|
4
|
+
ref="root"
|
|
5
|
+
:data-blokkli-editable-field="name ?? void 0"
|
|
6
|
+
>
|
|
7
|
+
<slot :value="renderedValue" />
|
|
8
|
+
</component>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import {
|
|
13
|
+
ref,
|
|
14
|
+
computed,
|
|
15
|
+
inject,
|
|
16
|
+
onMounted,
|
|
17
|
+
onBeforeUnmount,
|
|
18
|
+
useTemplateRef,
|
|
19
|
+
watch
|
|
20
|
+
} from "#imports";
|
|
21
|
+
import {
|
|
22
|
+
INJECT_APP,
|
|
23
|
+
INJECT_EDIT_CONTEXT,
|
|
24
|
+
INJECT_ENTITY_CONTEXT,
|
|
25
|
+
INJECT_IS_IN_REUSABLE
|
|
26
|
+
} from "#blokkli/helpers/injections";
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
name: { type: [String, null], required: false, default: null },
|
|
29
|
+
value: { type: String, required: false, default: "" },
|
|
30
|
+
tag: { type: String, required: false, default: "div" }
|
|
31
|
+
});
|
|
32
|
+
defineSlots();
|
|
33
|
+
const root = useTemplateRef("root");
|
|
34
|
+
const entity = inject(INJECT_ENTITY_CONTEXT, null);
|
|
35
|
+
const editContext = inject(INJECT_EDIT_CONTEXT, null);
|
|
36
|
+
const app = inject(INJECT_APP, null);
|
|
37
|
+
const isInReusable = inject(INJECT_IS_IN_REUSABLE, false);
|
|
38
|
+
const valueOverride = ref("");
|
|
39
|
+
const renderedValue = computed(() => valueOverride.value || props.value || "");
|
|
40
|
+
const onEditableUpdateValue = (e) => {
|
|
41
|
+
if (e.name === props.name && e.entityUuid === entity?.uuid) {
|
|
42
|
+
valueOverride.value = e.value;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
function getValueCallback() {
|
|
46
|
+
return props.value;
|
|
47
|
+
}
|
|
48
|
+
function onStateReloaded() {
|
|
49
|
+
valueOverride.value = "";
|
|
50
|
+
}
|
|
51
|
+
function registerDirective(name) {
|
|
52
|
+
if (!name || !app || !(root.value instanceof HTMLElement) || !entity) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
app.directive.registerDirectiveElement(
|
|
56
|
+
root.value,
|
|
57
|
+
name,
|
|
58
|
+
entity,
|
|
59
|
+
"editable",
|
|
60
|
+
true,
|
|
61
|
+
getValueCallback
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function unregisterDirective(name) {
|
|
65
|
+
if (!name || !app || !(root.value instanceof HTMLElement) || !entity) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
app.directive.unregisterDirectiveElement(root.value, name, entity, "editable");
|
|
69
|
+
}
|
|
70
|
+
onMounted(() => {
|
|
71
|
+
if (!editContext || !app || isInReusable) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
editContext.eventBus.on("editable:update", onEditableUpdateValue);
|
|
75
|
+
editContext.eventBus.on("state:reloaded", onStateReloaded);
|
|
76
|
+
registerDirective(props.name);
|
|
77
|
+
});
|
|
78
|
+
watch(
|
|
79
|
+
() => props.name,
|
|
80
|
+
(newName, oldName) => {
|
|
81
|
+
if (!app || !entity || isInReusable) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
unregisterDirective(oldName);
|
|
85
|
+
registerDirective(newName);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
onBeforeUnmount(() => {
|
|
89
|
+
if (editContext) {
|
|
90
|
+
editContext.eventBus.off("editable:update", onEditableUpdateValue);
|
|
91
|
+
editContext.eventBus.off("state:reloaded", onStateReloaded);
|
|
92
|
+
}
|
|
93
|
+
unregisterDirective(props.name);
|
|
94
|
+
});
|
|
95
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name?: string | null;
|
|
3
|
+
value?: string;
|
|
4
|
+
tag?: string;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_Slots = {
|
|
7
|
+
default(props: {
|
|
8
|
+
value: string;
|
|
9
|
+
}): any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
|
+
name: string | null;
|
|
13
|
+
value: string;
|
|
14
|
+
tag: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
language: string;
|
|
3
|
+
};
|
|
1
4
|
declare var __VLS_1: {};
|
|
2
5
|
type __VLS_Slots = {} & {
|
|
3
6
|
default?: (props: typeof __VLS_1) => any;
|
|
4
7
|
};
|
|
5
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
10
|
declare const _default: typeof __VLS_export;
|
|
8
11
|
export default _default;
|
|
@@ -47,8 +47,11 @@ import { computed, ref, onErrorCaptured } from "#imports";
|
|
|
47
47
|
import { Icon } from "#blokkli/editor/components";
|
|
48
48
|
import textProvider from "#blokkli/editor/providers/texts";
|
|
49
49
|
import { useGlobalBlokkliObject } from "#blokkli/editor/composables";
|
|
50
|
+
const props = defineProps({
|
|
51
|
+
language: { type: String, required: true }
|
|
52
|
+
});
|
|
50
53
|
const errors = ref([]);
|
|
51
|
-
const $t = textProvider();
|
|
54
|
+
const $t = await textProvider(props.language);
|
|
52
55
|
const globalBlokkli = useGlobalBlokkliObject();
|
|
53
56
|
onErrorCaptured((err) => {
|
|
54
57
|
errors.value.push(err);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
language: string;
|
|
3
|
+
};
|
|
1
4
|
declare var __VLS_1: {};
|
|
2
5
|
type __VLS_Slots = {} & {
|
|
3
6
|
default?: (props: typeof __VLS_1) => any;
|
|
4
7
|
};
|
|
5
|
-
declare const __VLS_base: import("vue").DefineComponent<
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
9
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
10
|
declare const _default: typeof __VLS_export;
|
|
8
11
|
export default _default;
|
|
@@ -93,12 +93,13 @@ import {
|
|
|
93
93
|
useBlokkli,
|
|
94
94
|
computed,
|
|
95
95
|
ref,
|
|
96
|
+
shallowRef,
|
|
96
97
|
watch,
|
|
97
98
|
onMounted
|
|
98
99
|
} from "#imports";
|
|
99
100
|
import { ArtboardTooltip, AddListItem, Icon } from "#blokkli/editor/components";
|
|
100
101
|
import { isInternalBundle } from "#blokkli/editor/helpers/bundles";
|
|
101
|
-
import {
|
|
102
|
+
import { loadFzf } from "#blokkli/editor/libraries/fzf";
|
|
102
103
|
import { fragmentBlockBundle } from "#blokkli-build/config";
|
|
103
104
|
const props = defineProps({
|
|
104
105
|
bundles: { type: Array, required: true },
|
|
@@ -231,8 +232,12 @@ const actions = computed(() => {
|
|
|
231
232
|
const allItems = computed(() => {
|
|
232
233
|
return [...blocks.value, ...fragments.value, ...actions.value];
|
|
233
234
|
});
|
|
234
|
-
const fzf =
|
|
235
|
-
|
|
235
|
+
const fzf = shallowRef(null);
|
|
236
|
+
onMounted(async () => {
|
|
237
|
+
const { Fzf } = await loadFzf();
|
|
238
|
+
fzf.value = new Fzf(allItems.value, {
|
|
239
|
+
selector: (item) => item.label + " " + item.description
|
|
240
|
+
});
|
|
236
241
|
});
|
|
237
242
|
function filterBySearch(items) {
|
|
238
243
|
const text = searchText.value.trim();
|
|
@@ -246,10 +251,10 @@ function filterBySearch(items) {
|
|
|
246
251
|
}
|
|
247
252
|
const filteredBlocks = computed(() => {
|
|
248
253
|
const text = searchText.value.trim();
|
|
249
|
-
if (!text) {
|
|
254
|
+
if (!text || !fzf.value) {
|
|
250
255
|
return blocks.value;
|
|
251
256
|
}
|
|
252
|
-
const results = fzf.find(text);
|
|
257
|
+
const results = fzf.value.find(text);
|
|
253
258
|
const textLower = text.toLowerCase();
|
|
254
259
|
return results.map((r) => r.item).filter((item) => item.type === "block").sort((a, b) => {
|
|
255
260
|
const aInLabel = a.label.toLowerCase().includes(textLower);
|
|
@@ -198,33 +198,8 @@ export default {
|
|
|
198
198
|
--bk-tw-bg-opacity: 1;
|
|
199
199
|
background-color: rgb(255 255 255 / var(--bk-tw-bg-opacity, 1));
|
|
200
200
|
}
|
|
201
|
-
.bk.bk-dialog .bk.bk-overlay-header {
|
|
202
|
-
padding-left: 15px;
|
|
203
|
-
font-size: 18px;
|
|
204
|
-
line-height: 28px;
|
|
205
|
-
}
|
|
206
|
-
.bk.bk-dialog .bk.bk-overlay-header > button {
|
|
207
|
-
padding: 15px;
|
|
208
|
-
}
|
|
209
|
-
.bk.bk-dialog .bk.bk-overlay-header > button:hover {
|
|
210
|
-
--bk-tw-bg-opacity: 1;
|
|
211
|
-
background-color: rgb(var(--bk-theme-mono-800) / var(--bk-tw-bg-opacity, 1));
|
|
212
|
-
}
|
|
213
|
-
.bk.bk-dialog .bk.bk-overlay-header > button:focus-visible {
|
|
214
|
-
--bk-tw-bg-opacity: 1;
|
|
215
|
-
background-color: rgb(var(--bk-theme-mono-800) / var(--bk-tw-bg-opacity, 1));
|
|
216
|
-
outline-width: 2px;
|
|
217
|
-
outline-offset: -2px;
|
|
218
|
-
outline-color: rgb(var(--bk-theme-mono-100) / 1);
|
|
219
|
-
}
|
|
220
201
|
}
|
|
221
202
|
|
|
222
|
-
@media (min-width: 1024px) {
|
|
223
|
-
.bk.bk-dialog .bk.bk-overlay-header {
|
|
224
|
-
padding-left: 25px;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
203
|
.bk.bk-dialog .bk-dialog-lead {
|
|
229
204
|
margin-bottom: 10px;
|
|
230
205
|
font-family: PB Inter, sans-serif;
|
|
@@ -385,58 +360,6 @@ export default {
|
|
|
385
360
|
}
|
|
386
361
|
}
|
|
387
362
|
|
|
388
|
-
.bk.bk-overlay-header {
|
|
389
|
-
display: flex;
|
|
390
|
-
align-items: center;
|
|
391
|
-
--bk-tw-bg-opacity: 1;
|
|
392
|
-
background-color: rgb(0 0 0 / var(--bk-tw-bg-opacity, 1));
|
|
393
|
-
padding-left: 10px;
|
|
394
|
-
font-size: 16px;
|
|
395
|
-
line-height: 24px;
|
|
396
|
-
line-height: 1;
|
|
397
|
-
--bk-tw-text-opacity: 1;
|
|
398
|
-
color: rgb(255 255 255 / var(--bk-tw-text-opacity, 1));
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.bk.bk-overlay-header > .bk-icon,
|
|
402
|
-
.bk.bk-overlay-header > .bk-blokkli-item-icon {
|
|
403
|
-
margin-right: 5px;
|
|
404
|
-
height: auto;
|
|
405
|
-
width: auto;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.bk.bk-overlay-header > .bk-icon svg, .bk.bk-overlay-header > .bk-blokkli-item-icon svg {
|
|
409
|
-
height: 1.25em;
|
|
410
|
-
width: 1.25em;
|
|
411
|
-
fill: currentColor;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
.bk.bk-overlay-header h3 {
|
|
415
|
-
font-weight: 700;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
.bk.bk-overlay-header > button {
|
|
419
|
-
margin-left: auto;
|
|
420
|
-
display: flex;
|
|
421
|
-
width: 60px;
|
|
422
|
-
height: 60px;
|
|
423
|
-
align-items: center;
|
|
424
|
-
justify-content: center;
|
|
425
|
-
padding-left: 10px;
|
|
426
|
-
padding-right: 10px;
|
|
427
|
-
padding-top: 15px;
|
|
428
|
-
padding-bottom: 15px;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.bk.bk-overlay-header > button .bk-icon {
|
|
432
|
-
height: 1.25em;
|
|
433
|
-
width: 1.25em;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.bk.bk-overlay-header > button .bk-icon svg {
|
|
437
|
-
fill: currentColor;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
363
|
.bk .bk-dialog-content-element {
|
|
441
364
|
margin-bottom: 30px;
|
|
442
365
|
display: flex;
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
|
|
23
23
|
<script setup>
|
|
24
|
-
import textProvider from "#blokkli/editor/providers/texts";
|
|
25
24
|
import {
|
|
26
25
|
ref,
|
|
27
26
|
onMounted,
|
|
@@ -34,12 +33,14 @@ import "#blokkli-build/styles.css";
|
|
|
34
33
|
import { useAnimationFrame } from "#blokkli/editor/composables";
|
|
35
34
|
const props = defineProps({
|
|
36
35
|
uuid: { type: String, required: true },
|
|
36
|
+
language: { type: String, required: true },
|
|
37
37
|
entityType: { type: String, required: true },
|
|
38
38
|
editLabel: { type: String, required: false },
|
|
39
39
|
permissions: { type: Array, required: true }
|
|
40
40
|
});
|
|
41
41
|
const key = computed(() => props.entityType + ":" + props.uuid);
|
|
42
|
-
const
|
|
42
|
+
const textProvider = await import("./../providers/texts").then((v) => v.default);
|
|
43
|
+
const $t = await textProvider(props.language);
|
|
43
44
|
const label = computed(() => {
|
|
44
45
|
if (props.editLabel) {
|
|
45
46
|
return props.editLabel;
|
|
@@ -12,6 +12,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
12
12
|
permissions: Array<EditPermission | null>;
|
|
13
13
|
providerEl: HTMLElement;
|
|
14
14
|
providerType: ValidProviderTypes;
|
|
15
|
+
} & {
|
|
16
|
+
onReady?: (() => any) | undefined;
|
|
15
17
|
}> & (typeof globalThis extends {
|
|
16
18
|
__VLS_PROPS_FALLBACK: infer P;
|
|
17
19
|
} ? P : {});
|
|
@@ -23,7 +25,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
23
25
|
key: string;
|
|
24
26
|
}): any;
|
|
25
27
|
};
|
|
26
|
-
emit:
|
|
28
|
+
emit: (e: "ready") => void;
|
|
27
29
|
}>) => import("vue").VNode & {
|
|
28
30
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
31
|
};
|
|
@@ -86,6 +86,7 @@ import Messages from "./Messages/index.vue";
|
|
|
86
86
|
import FeaturesRenderer from "./FeaturesRenderer/index.vue";
|
|
87
87
|
import Indicators from "./Indicators/index.vue";
|
|
88
88
|
import DraggableList from "./DraggableList.vue";
|
|
89
|
+
import BlokkliEditableEdit from "./BlokkliEditableEdit.vue";
|
|
89
90
|
import AnimationCanvas from "./AnimationCanvas/index.vue";
|
|
90
91
|
import SystemRequirements from "./SystemRequirements/index.vue";
|
|
91
92
|
import Overlay from "./Overlay/index.vue";
|
|
@@ -122,6 +123,7 @@ import readabilityProviderFn from "#blokkli/editor/providers/readability";
|
|
|
122
123
|
import fieldValueProviderFn from "#blokkli/editor/providers/fieldValue";
|
|
123
124
|
import dragdropProvider from "#blokkli/editor/providers/dragdrop";
|
|
124
125
|
import cacheProvider from "#blokkli/editor/providers/cache";
|
|
126
|
+
import workspacesProvider from "#blokkli/editor/providers/workspaces";
|
|
125
127
|
import { eventBus } from "#blokkli/editor/events";
|
|
126
128
|
import "#blokkli-build/styles.css";
|
|
127
129
|
import getAdapter from "#blokkli-build/edit-adapter";
|
|
@@ -131,6 +133,7 @@ import {
|
|
|
131
133
|
INJECT_APP,
|
|
132
134
|
INJECT_EDIT_CONTEXT,
|
|
133
135
|
INJECT_EDIT_FIELD_LIST_COMPONENT,
|
|
136
|
+
INJECT_EDIT_EDITABLE_COMPONENT,
|
|
134
137
|
INJECT_EDIT_LOGGER,
|
|
135
138
|
INJECT_ENTITY_CONTEXT,
|
|
136
139
|
INJECT_GLOBAL_PROXY_MODE,
|
|
@@ -156,6 +159,7 @@ const props = defineProps({
|
|
|
156
159
|
providerType: { type: null, required: true }
|
|
157
160
|
});
|
|
158
161
|
defineSlots();
|
|
162
|
+
const emit = defineEmits(["ready"]);
|
|
159
163
|
const mainLayoutElement = useTemplateRef("mainLayoutElement");
|
|
160
164
|
const viewportElement = useTemplateRef("viewportElement");
|
|
161
165
|
const entityContext = computed(() => {
|
|
@@ -181,7 +185,7 @@ const toolbarLoaded = ref(false);
|
|
|
181
185
|
const featuresLoaded = ref(false);
|
|
182
186
|
const isInitializing = ref(true);
|
|
183
187
|
const definitions = definitionProvider(props.providerType);
|
|
184
|
-
const $t = textProvider(context);
|
|
188
|
+
const $t = await textProvider(context.value.language);
|
|
185
189
|
const state = await editStateProvider(
|
|
186
190
|
eventBus,
|
|
187
191
|
adapter,
|
|
@@ -235,7 +239,7 @@ const fieldValue = fieldValueProviderFn(
|
|
|
235
239
|
definitions,
|
|
236
240
|
blocks
|
|
237
241
|
);
|
|
238
|
-
const readability = readabilityProviderFn(
|
|
242
|
+
const readability = await readabilityProviderFn(
|
|
239
243
|
adapters,
|
|
240
244
|
context,
|
|
241
245
|
directive,
|
|
@@ -244,6 +248,7 @@ const readability = readabilityProviderFn(
|
|
|
244
248
|
const analyze = analyzeProviderFn(adapters, state, ui, context, $t, readability);
|
|
245
249
|
const dragdrop = dragdropProvider();
|
|
246
250
|
const cache = cacheProvider();
|
|
251
|
+
const workspaces = workspacesProvider(adapter, context, state);
|
|
247
252
|
const mutatedEntityProps = computed(() => state.mutatedItemProps.HOST);
|
|
248
253
|
const mutatedEntity = computed(() => {
|
|
249
254
|
return {
|
|
@@ -292,13 +297,15 @@ function setElementSymbolProperty(el, symbol, value) {
|
|
|
292
297
|
provide(INJECT_EDIT_LOGGER, baseLogger);
|
|
293
298
|
provide(INJECT_ALL_COMPONENTS_CHUNK, allComponents);
|
|
294
299
|
provide(INJECT_EDIT_FIELD_LIST_COMPONENT, DraggableList);
|
|
300
|
+
provide(INJECT_EDIT_EDITABLE_COMPONENT, BlokkliEditableEdit);
|
|
295
301
|
provide(INJECT_IS_EDITING, true);
|
|
296
302
|
provide(INJECT_EDIT_CONTEXT, {
|
|
297
303
|
eventBus,
|
|
298
304
|
mutatedOptions: state.mutatedOptions,
|
|
299
305
|
dom,
|
|
300
306
|
definitions,
|
|
301
|
-
useBlockRegistration
|
|
307
|
+
useBlockRegistration,
|
|
308
|
+
selectedUuids: computed(() => selection.uuids.value)
|
|
302
309
|
});
|
|
303
310
|
const app = {
|
|
304
311
|
$t,
|
|
@@ -333,7 +340,8 @@ const app = {
|
|
|
333
340
|
readability,
|
|
334
341
|
fieldValue,
|
|
335
342
|
dragdrop,
|
|
336
|
-
cache
|
|
343
|
+
cache,
|
|
344
|
+
workspaces
|
|
337
345
|
};
|
|
338
346
|
provide(INJECT_APP, app);
|
|
339
347
|
function textWithHighlight(title, text) {
|
|
@@ -426,6 +434,7 @@ onMounted(async () => {
|
|
|
426
434
|
await nextTick();
|
|
427
435
|
isInitializing.value = false;
|
|
428
436
|
broadcast.emit("editorLoaded", { uuid: props.entityUuid });
|
|
437
|
+
emit("ready");
|
|
429
438
|
baseLogger.log("onMounted - END");
|
|
430
439
|
});
|
|
431
440
|
onBeforeUnmount(() => {
|
|
@@ -12,6 +12,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
12
12
|
permissions: Array<EditPermission | null>;
|
|
13
13
|
providerEl: HTMLElement;
|
|
14
14
|
providerType: ValidProviderTypes;
|
|
15
|
+
} & {
|
|
16
|
+
onReady?: (() => any) | undefined;
|
|
15
17
|
}> & (typeof globalThis extends {
|
|
16
18
|
__VLS_PROPS_FALLBACK: infer P;
|
|
17
19
|
} ? P : {});
|
|
@@ -23,7 +25,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
23
25
|
key: string;
|
|
24
26
|
}): any;
|
|
25
27
|
};
|
|
26
|
-
emit:
|
|
28
|
+
emit: (e: "ready") => void;
|
|
27
29
|
}>) => import("vue").VNode & {
|
|
28
30
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
31
|
};
|
|
@@ -19,7 +19,7 @@ const renderedFeatures = computed(
|
|
|
19
19
|
);
|
|
20
20
|
const disabledFeatures = adapter.getDisabledFeatures ? await adapter.getDisabledFeatures() : await Promise.resolve([]);
|
|
21
21
|
const availableFeatures = computed(() => {
|
|
22
|
-
return features.
|
|
22
|
+
return features.definitions.value.filter((feature) => {
|
|
23
23
|
if (disabledFeatures.includes(feature.id)) {
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
@@ -42,9 +42,6 @@ const availableFeatures = computed(() => {
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
if (feature.dependencies?.length && !feature.dependencies.every((id) => renderedFeatures.value.includes(id))) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
45
|
if (feature.beta && !features.enabledBetaFeatures.value.includes(
|
|
49
46
|
feature.id
|
|
50
47
|
)) {
|
|
@@ -8,6 +8,11 @@ type __VLS_Props = {
|
|
|
8
8
|
minlength?: string | number;
|
|
9
9
|
maxlength?: string | number;
|
|
10
10
|
type?: string;
|
|
11
|
+
/**
|
|
12
|
+
* If true, the model is only updated on `change` (blur / Enter), matching
|
|
13
|
+
* Vue's `v-model.lazy` behavior. Defaults to eager (per-keystroke).
|
|
14
|
+
*/
|
|
15
|
+
lazy?: boolean;
|
|
11
16
|
};
|
|
12
17
|
type __VLS_ModelProps = {
|
|
13
18
|
modelValue?: string;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="bk-form-text">
|
|
7
7
|
<input
|
|
8
8
|
:id
|
|
9
|
-
|
|
9
|
+
:value="value"
|
|
10
10
|
type="text"
|
|
11
11
|
class="bk-form-input"
|
|
12
12
|
:placeholder
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
:disabled
|
|
15
15
|
:minlength
|
|
16
16
|
:maxlength
|
|
17
|
+
@[updateEvent]="onUpdate"
|
|
17
18
|
/>
|
|
18
19
|
<button
|
|
19
20
|
type="button"
|
|
@@ -29,8 +30,8 @@
|
|
|
29
30
|
|
|
30
31
|
<script setup>
|
|
31
32
|
import { Icon } from "#blokkli/editor/components";
|
|
32
|
-
import { useBlokkli } from "#imports";
|
|
33
|
-
defineProps({
|
|
33
|
+
import { computed, useBlokkli } from "#imports";
|
|
34
|
+
const props = defineProps({
|
|
34
35
|
id: { type: String, required: true },
|
|
35
36
|
label: { type: String, required: true },
|
|
36
37
|
description: { type: String, required: false },
|
|
@@ -39,8 +40,13 @@ defineProps({
|
|
|
39
40
|
disabled: { type: Boolean, required: false },
|
|
40
41
|
minlength: { type: [String, Number], required: false },
|
|
41
42
|
maxlength: { type: [String, Number], required: false },
|
|
42
|
-
type: { type: String, required: false }
|
|
43
|
+
type: { type: String, required: false },
|
|
44
|
+
lazy: { type: Boolean, required: false }
|
|
43
45
|
});
|
|
46
|
+
const updateEvent = computed(() => props.lazy ? "change" : "input");
|
|
44
47
|
const value = defineModel({ type: String });
|
|
48
|
+
function onUpdate(event) {
|
|
49
|
+
value.value = event.target.value;
|
|
50
|
+
}
|
|
45
51
|
const { $t } = useBlokkli();
|
|
46
52
|
</script>
|
|
@@ -8,6 +8,11 @@ type __VLS_Props = {
|
|
|
8
8
|
minlength?: string | number;
|
|
9
9
|
maxlength?: string | number;
|
|
10
10
|
type?: string;
|
|
11
|
+
/**
|
|
12
|
+
* If true, the model is only updated on `change` (blur / Enter), matching
|
|
13
|
+
* Vue's `v-model.lazy` behavior. Defaults to eager (per-keystroke).
|
|
14
|
+
*/
|
|
15
|
+
lazy?: boolean;
|
|
11
16
|
};
|
|
12
17
|
type __VLS_ModelProps = {
|
|
13
18
|
modelValue?: string;
|
|
@@ -118,28 +118,4 @@ export default {
|
|
|
118
118
|
height: 100%;
|
|
119
119
|
flex-direction: column;
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
.bk-vars.bk-form-overlay .bk.bk-overlay-header {
|
|
123
|
-
z-index: calc(var(--bk-z-index-base) + 360000) /* "form-overlay-header" */;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
@media (min-width: 768px) {
|
|
127
|
-
|
|
128
|
-
.bk-vars.bk-form-overlay .bk.bk-overlay-header {
|
|
129
|
-
height: 50px;
|
|
130
|
-
--bk-tw-bg-opacity: 1;
|
|
131
|
-
background-color: rgb(var(--bk-theme-mono-900) / var(--bk-tw-bg-opacity, 1));
|
|
132
|
-
padding-left: 15px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.bk-vars.bk-form-overlay .bk.bk-overlay-header > button {
|
|
136
|
-
aspect-ratio: 1 / 1;
|
|
137
|
-
height: 100%;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.bk-vars.bk-form-overlay .bk.bk-overlay-header > button:hover {
|
|
141
|
-
--bk-tw-bg-opacity: 1;
|
|
142
|
-
background-color: rgb(var(--bk-theme-mono-800) / var(--bk-tw-bg-opacity, 1));
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
121
|
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
4
|
+
default?: (props: {}) => any;
|
|
5
|
+
}>;
|
|
6
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
7
|
+
new (): {
|
|
8
|
+
$slots: S;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="minHeight ? { minHeight: `${minHeight}px` } : void 0">
|
|
3
|
+
<div ref="inner">
|
|
4
|
+
<slot />
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { useTemplateRef, ref, onMounted, onBeforeUnmount } from "#imports";
|
|
11
|
+
const inner = useTemplateRef("inner");
|
|
12
|
+
const minHeight = ref(0);
|
|
13
|
+
let observer = null;
|
|
14
|
+
onMounted(() => {
|
|
15
|
+
const el = inner.value;
|
|
16
|
+
if (!el) return;
|
|
17
|
+
observer = new ResizeObserver(() => {
|
|
18
|
+
const h = el.scrollHeight;
|
|
19
|
+
if (h > minHeight.value) {
|
|
20
|
+
minHeight.value = h;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
observer.observe(el);
|
|
24
|
+
});
|
|
25
|
+
onBeforeUnmount(() => {
|
|
26
|
+
observer?.disconnect();
|
|
27
|
+
});
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
export default {
|
|
32
|
+
name: "GrowOnly"
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
4
|
+
default?: (props: {}) => any;
|
|
5
|
+
}>;
|
|
6
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
7
|
+
new (): {
|
|
8
|
+
$slots: S;
|
|
9
|
+
};
|
|
10
|
+
};
|