@bagelink/vue 0.0.358 → 0.0.360
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/RichText.vue"],"names":[],"mappings":"AAcA;;
|
|
1
|
+
{"version":3,"file":"RichText.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/form/inputs/RichText.vue"],"names":[],"mappings":"AAcA;;gBAgQyD,MAAM;;;;gBAAN,MAAM;;;;AAL/D,wBAOG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -39216,13 +39216,22 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
39216
39216
|
}
|
|
39217
39217
|
];
|
|
39218
39218
|
const emit2 = __emit;
|
|
39219
|
-
|
|
39219
|
+
function initEditor() {
|
|
39220
39220
|
editor.value = new Editor({
|
|
39221
39221
|
extensions: [StarterKit],
|
|
39222
39222
|
content: props2.modelValue,
|
|
39223
39223
|
onUpdate: ({ editor: editor2 }) => emit2("update:modelValue", editor2.getHTML())
|
|
39224
39224
|
});
|
|
39225
|
-
}
|
|
39225
|
+
}
|
|
39226
|
+
vue.watch(
|
|
39227
|
+
() => props2.modelValue,
|
|
39228
|
+
(value) => {
|
|
39229
|
+
var _a2;
|
|
39230
|
+
return (_a2 = editor.value) == null ? void 0 : _a2.commands.setContent(value);
|
|
39231
|
+
},
|
|
39232
|
+
{ immediate: true }
|
|
39233
|
+
);
|
|
39234
|
+
vue.onMounted(initEditor);
|
|
39226
39235
|
vue.onBeforeUnmount(() => {
|
|
39227
39236
|
var _a2;
|
|
39228
39237
|
return (_a2 = editor.value) == null ? void 0 : _a2.destroy();
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField2 = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeStyle, withKeys, createElementVNode, Fragment as Fragment$1, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h as h$2, toDisplayString, inject, unref, renderList, resolveDynamicComponent, useCssVars, useSlots, computed, withModifiers, createTextVNode, watch, onMounted, onUnmounted, mergeModels, useModel, createSlots, Transition, reactive, provide, withDirectives, vModelCheckbox, toRef, isRef, Teleport, render as render$f, onBeforeUpdate, vShow, getCurrentScope, onScopeDispose, TransitionGroup, vModelDynamic, vModelText, vModelRadio, onBeforeUnmount,
|
|
7
|
+
import { pushScopeId, popScopeId, defineComponent, nextTick, openBlock, createBlock, createElementBlock, normalizeClass, renderSlot, normalizeProps, guardReactiveProps, withScopeId, resolveComponent, normalizeStyle, withKeys, createElementVNode, Fragment as Fragment$1, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h as h$2, toDisplayString, inject, unref, renderList, resolveDynamicComponent, useCssVars, useSlots, computed, withModifiers, createTextVNode, watch, onMounted, onUnmounted, mergeModels, useModel, createSlots, Transition, reactive, provide, withDirectives, vModelCheckbox, toRef, isRef, Teleport, render as render$f, onBeforeUpdate, vShow, getCurrentScope, onScopeDispose, TransitionGroup, vModelDynamic, vModelText, vModelRadio, onBeforeUnmount, getCurrentInstance, watchEffect, markRaw, customRef, resolveDirective } from "vue";
|
|
8
8
|
const sides = ["top", "right", "bottom", "left"];
|
|
9
9
|
const alignments = ["start", "end"];
|
|
10
10
|
const placements$1 = /* @__PURE__ */ sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
|
|
@@ -39214,13 +39214,22 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
39214
39214
|
}
|
|
39215
39215
|
];
|
|
39216
39216
|
const emit2 = __emit;
|
|
39217
|
-
|
|
39217
|
+
function initEditor() {
|
|
39218
39218
|
editor.value = new Editor({
|
|
39219
39219
|
extensions: [StarterKit],
|
|
39220
39220
|
content: props2.modelValue,
|
|
39221
39221
|
onUpdate: ({ editor: editor2 }) => emit2("update:modelValue", editor2.getHTML())
|
|
39222
39222
|
});
|
|
39223
|
-
}
|
|
39223
|
+
}
|
|
39224
|
+
watch(
|
|
39225
|
+
() => props2.modelValue,
|
|
39226
|
+
(value) => {
|
|
39227
|
+
var _a2;
|
|
39228
|
+
return (_a2 = editor.value) == null ? void 0 : _a2.commands.setContent(value);
|
|
39229
|
+
},
|
|
39230
|
+
{ immediate: true }
|
|
39231
|
+
);
|
|
39232
|
+
onMounted(initEditor);
|
|
39224
39233
|
onBeforeUnmount(() => {
|
|
39225
39234
|
var _a2;
|
|
39226
39235
|
return (_a2 = editor.value) == null ? void 0 : _a2.destroy();
|
package/dist/style.css
CHANGED
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
<script setup lang="ts">
|
|
17
17
|
import { Btn } from '@bagelink/vue';
|
|
18
|
-
import { onMounted, onBeforeUnmount } from 'vue';
|
|
18
|
+
import { onMounted, onBeforeUnmount, watch } from 'vue';
|
|
19
19
|
import StarterKit from '@tiptap/starter-kit';
|
|
20
20
|
import { Editor, EditorContent } from '@tiptap/vue-3';
|
|
21
21
|
import type { MaterialIcons } from '@bagelink/vue';
|
|
@@ -156,13 +156,21 @@ const config: {
|
|
|
156
156
|
|
|
157
157
|
const emit = defineEmits(['update:modelValue']);
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
function initEditor() {
|
|
160
160
|
editor = new Editor({
|
|
161
161
|
extensions: [StarterKit],
|
|
162
162
|
content: props.modelValue,
|
|
163
163
|
onUpdate: ({ editor }) => emit('update:modelValue', editor.getHTML()),
|
|
164
164
|
});
|
|
165
|
-
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
watch(
|
|
168
|
+
() => props.modelValue,
|
|
169
|
+
(value) => editor?.commands.setContent(value),
|
|
170
|
+
{ immediate: true }
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
onMounted(initEditor);
|
|
166
174
|
|
|
167
175
|
onBeforeUnmount(() => editor?.destroy());
|
|
168
176
|
</script>
|
|
@@ -226,5 +234,7 @@ onBeforeUnmount(() => editor?.destroy());
|
|
|
226
234
|
.tiptap {
|
|
227
235
|
min-height: 500px;
|
|
228
236
|
background: var(--input-bg);
|
|
237
|
+
overflow: auto;
|
|
238
|
+
max-height: 600px;
|
|
229
239
|
}
|
|
230
240
|
</style>
|