feat: create deployment scripts
This commit is contained in:
parent
78297efe5c
commit
8d5bce4bfb
22 changed files with 2697 additions and 74 deletions
|
|
@ -2,7 +2,6 @@ import {
|
|||
component$,
|
||||
useSignal,
|
||||
useVisibleTask$,
|
||||
useComputed$,
|
||||
$,
|
||||
noSerialize,
|
||||
useStore,
|
||||
|
|
@ -12,7 +11,7 @@ import {
|
|||
import { type DocumentHead, routeLoader$ } from "@builder.io/qwik-city";
|
||||
import { EditorState, Plugin, Transaction } from "prosemirror-state";
|
||||
import { EditorView, Decoration, DecorationSet } from "prosemirror-view";
|
||||
import { Schema, DOMParser, Node as PMNode } from "prosemirror-model";
|
||||
import { Schema, Node as PMNode } from "prosemirror-model";
|
||||
import { schema as basicSchema } from "prosemirror-schema-basic";
|
||||
import { keymap } from "prosemirror-keymap";
|
||||
import { baseKeymap } from "prosemirror-commands";
|
||||
|
|
@ -123,7 +122,7 @@ export default component$(() => {
|
|||
const models = useSignal<string[]>([]);
|
||||
const currentModel = useSignal("all-mpnet-base-v2");
|
||||
const syncState = useSignal<SyncState>("clean");
|
||||
const editorView = useSignal<EditorView | null>(null);
|
||||
const editorView = useSignal<NoSerialize<EditorView>>();
|
||||
const sentenceDecorations = useSignal<SentenceDecoration[]>([]);
|
||||
const salienceData = useSignal<SalienceData | null>(null);
|
||||
const debounceTimer = useSignal<number | null>(null);
|
||||
|
|
@ -224,15 +223,20 @@ export default component$(() => {
|
|||
|
||||
// Parse the initial document text into separate paragraphs
|
||||
// Split by single newlines and preserve blank lines as empty paragraphs
|
||||
const paragraphs = initialDocument.value
|
||||
.split('\n')
|
||||
.map(line => {
|
||||
// Create paragraph with text if line has content, otherwise empty paragraph
|
||||
const content = line.length > 0 ? [salienceSchema.text(line)] : [];
|
||||
return salienceSchema.node("paragraph", null, content);
|
||||
});
|
||||
const lines = initialDocument.value
|
||||
.split('\n');
|
||||
|
||||
const paragraphs: PMNode[] = [];
|
||||
lines.forEach((line) => {
|
||||
// Create paragraph with text if line has content, otherwise empty paragraph
|
||||
const content = line.length > 0 ? [salienceSchema.text(line)] : [];
|
||||
//content.push(salienceSchema.node("hard_break"));
|
||||
paragraphs.push(salienceSchema.node("paragraph", null, content));
|
||||
});
|
||||
console.log(paragraphs);
|
||||
|
||||
const initialDoc = salienceSchema.node("doc", null, paragraphs);
|
||||
console.log(initialDoc.textContent);
|
||||
|
||||
const state = EditorState.create({
|
||||
schema: salienceSchema,
|
||||
|
|
@ -272,7 +276,7 @@ export default component$(() => {
|
|||
},
|
||||
});
|
||||
|
||||
editorView.value = view;
|
||||
editorView.value = noSerialize(view);
|
||||
|
||||
fetchSalienceData(
|
||||
currentModel.value,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue