Skip to content

Commit

Permalink
Finish
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyballentine committed Jan 15, 2024
1 parent 9f23e34 commit c1d42b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
12 changes: 9 additions & 3 deletions backend/src/packages/chaiNNer_standard/utility/text/note.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from __future__ import annotations

from nodes.properties.inputs import TextInput
from nodes.properties.inputs import BoolInput, TextInput

from .. import text_group


# This node is a bit special as it has special handling by the frontend. Changes made here will not necessarily be reflected in the frontend.
@text_group.register(
schema_id="chainner:utility:note",
name="Note",
description="Make a sticky note for whatever notes or comments you want to leave in the chain.",
description="Make a sticky note for whatever notes or comments you want to leave in the chain. Supports markdown syntax",
icon="MdOutlineStickyNote2",
inputs=[
TextInput(
Expand All @@ -17,8 +18,13 @@
has_handle=False,
hide_label=True,
).make_optional(),
BoolInput(
label="Display Markdown",
default=False,
),
],
outputs=[],
node_type="note", # type: ignore -- this is not part of the public API
)
def note_node(_text: str | None) -> None:
def note_node(_text: str | None, display_markdown: bool | None) -> None:
return
11 changes: 0 additions & 11 deletions src/common/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1873,16 +1873,6 @@ const unifiedResizeNode: ModernMigration = (data) => {
return data;
};

const newNoteNode: ModernMigration = (data) => {
data.nodes.forEach((node) => {
if (node.data.schemaId === 'chainner:utility:note') {
// node.data.schemaId = 'chainner:builtin:note' as SchemaId;
node.type = 'note';
}
});
return data;
};

// ==============

const versionToMigration = (version: string) => {
Expand Down Expand Up @@ -1939,7 +1929,6 @@ const migrations = [
removeZIndexes,
createBorderEdgesTileFillToPad,
unifiedResizeNode,
newNoteNode,
];

export const currentMigration = migrations.length;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/node/special/NoteNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export interface NodeProps {
}

enum EditorMode {
Md,
Text,
Md,
}

const noteScrollbarStyle = {
Expand Down

0 comments on commit c1d42b4

Please sign in to comment.