notesoup 0.51.4 → 0.51.5
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/package.json
CHANGED
|
@@ -3,22 +3,12 @@ import { Icon } from "@getpaseo/plugin/client/react-native";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Pressable, ScrollView, Text, View } from "react-native";
|
|
5
5
|
import type { NotesOp } from "../shared/notes-op.ts";
|
|
6
|
+
import { PAPER, PaperCard } from "./paper-card.tsx";
|
|
6
7
|
|
|
7
8
|
const OP_LABEL: Record<NotesOp["op"], string> = { read: "READ NOTE", write: "WROTE NOTE", update: "UPDATED NOTE" };
|
|
8
9
|
const OP_LABEL_RUNNING: Record<NotesOp["op"], string> = { read: "READING NOTE", write: "WRITING NOTE", update: "UPDATING NOTE" };
|
|
9
10
|
const CHANGE_LABEL: Record<string, string> = { body: "edited", metadata: "metadata", moved: "renamed", none: "unchanged" };
|
|
10
11
|
|
|
11
|
-
/** Paper palette: pale note paper, readable regardless of the host theme. */
|
|
12
|
-
const PAPER = {
|
|
13
|
-
background: "#f7f2df",
|
|
14
|
-
border: "#d9cdaa",
|
|
15
|
-
tape: "#d8c98f",
|
|
16
|
-
ink: "#33301f",
|
|
17
|
-
inkMuted: "#867c63",
|
|
18
|
-
added: "#357a44",
|
|
19
|
-
removed: "#b0493e",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
12
|
function DiffBody({ diff }: { diff: string }) {
|
|
23
13
|
return (
|
|
24
14
|
<View style={{ gap: 2 }}>
|
|
@@ -46,21 +36,7 @@ export function NotesOpCard({ item, layout }: PluginTimelineItemProps<NotesOp>)
|
|
|
46
36
|
const showEllipsis = data.truncated && data.diff === undefined;
|
|
47
37
|
const hasBody = Boolean(data.text || data.preview || data.diff || footnotes.length);
|
|
48
38
|
return (
|
|
49
|
-
<
|
|
50
|
-
<View style={{
|
|
51
|
-
alignSelf: "flex-start", width: 84, height: 14, marginLeft: 28, marginBottom: -9, zIndex: 1,
|
|
52
|
-
backgroundColor: PAPER.tape, opacity: 0.9, borderRadius: 2,
|
|
53
|
-
transform: [{ rotate: "-2deg" }],
|
|
54
|
-
}} />
|
|
55
|
-
<View style={{
|
|
56
|
-
padding: layout.compact ? 10 : 12,
|
|
57
|
-
gap: 5,
|
|
58
|
-
minWidth: 0,
|
|
59
|
-
borderRadius: 4,
|
|
60
|
-
borderWidth: 1,
|
|
61
|
-
borderColor: PAPER.border,
|
|
62
|
-
backgroundColor: PAPER.background,
|
|
63
|
-
}}>
|
|
39
|
+
<PaperCard compact={layout.compact}>
|
|
64
40
|
<View style={{ gap: 3 }}>
|
|
65
41
|
<View style={{ flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 8 }}>
|
|
66
42
|
<Text style={{ color: PAPER.inkMuted, fontSize: 11, letterSpacing: 0.5 }}>
|
|
@@ -103,7 +79,6 @@ export function NotesOpCard({ item, layout }: PluginTimelineItemProps<NotesOp>)
|
|
|
103
79
|
>
|
|
104
80
|
<Icon name="ChevronUp" size={18} color={PAPER.inkMuted} />
|
|
105
81
|
</Pressable>}
|
|
106
|
-
|
|
107
|
-
</View>
|
|
82
|
+
</PaperCard>
|
|
108
83
|
);
|
|
109
84
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
/** Shared paper palette, independent of the host theme. */
|
|
5
|
+
export const PAPER = {
|
|
6
|
+
background: "#f7f2df",
|
|
7
|
+
border: "#d9cdaa",
|
|
8
|
+
tape: "#d8c98f",
|
|
9
|
+
ink: "#33301f",
|
|
10
|
+
inkMuted: "#867c63",
|
|
11
|
+
added: "#357a44",
|
|
12
|
+
removed: "#b0493e",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function PaperCard({ compact, children }: { compact: boolean; children: ReactNode }) {
|
|
16
|
+
return (
|
|
17
|
+
<View style={{ paddingTop: 6 }}>
|
|
18
|
+
<View style={{
|
|
19
|
+
alignSelf: "flex-start", width: 84, height: 14, marginLeft: 28, marginBottom: -9, zIndex: 1,
|
|
20
|
+
backgroundColor: PAPER.tape, opacity: 0.9, borderRadius: 2,
|
|
21
|
+
transform: [{ rotate: "-2deg" }],
|
|
22
|
+
}} />
|
|
23
|
+
<View style={{
|
|
24
|
+
padding: compact ? 10 : 12,
|
|
25
|
+
gap: 5,
|
|
26
|
+
minWidth: 0,
|
|
27
|
+
borderRadius: 4,
|
|
28
|
+
borderWidth: 1,
|
|
29
|
+
borderColor: PAPER.border,
|
|
30
|
+
backgroundColor: PAPER.background,
|
|
31
|
+
}}>
|
|
32
|
+
{children}
|
|
33
|
+
</View>
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -1,28 +1,14 @@
|
|
|
1
1
|
import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
|
|
2
|
-
import { Text
|
|
2
|
+
import { Text } from "react-native";
|
|
3
3
|
import type { LastWord } from "../shared/last-word.ts";
|
|
4
|
+
import { PAPER, PaperCard } from "./paper-card.tsx";
|
|
4
5
|
|
|
5
6
|
export function StickyCard({ item, layout }: PluginTimelineItemProps<LastWord>) {
|
|
6
7
|
const text = item.data.text.replace(/^\*You peel a sticky note off your forehead\.\*\n/, "");
|
|
7
8
|
return (
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
transform: [{ rotate: "-2deg" }],
|
|
13
|
-
}} />
|
|
14
|
-
<View style={{
|
|
15
|
-
padding: layout.compact ? 10 : 12,
|
|
16
|
-
gap: 5,
|
|
17
|
-
minWidth: 0,
|
|
18
|
-
borderRadius: 4,
|
|
19
|
-
borderWidth: 1,
|
|
20
|
-
borderColor: "#d9cdaa",
|
|
21
|
-
backgroundColor: "#f7f2df",
|
|
22
|
-
}}>
|
|
23
|
-
<Text style={{ color: "#867c63", fontSize: 11, letterSpacing: 0.5 }}>LAST WORD</Text>
|
|
24
|
-
<Text selectable style={{ color: "#33301f", fontSize: 13, lineHeight: 19, flexShrink: 1 }}>{text}</Text>
|
|
25
|
-
</View>
|
|
26
|
-
</View>
|
|
9
|
+
<PaperCard compact={layout.compact}>
|
|
10
|
+
<Text style={{ color: PAPER.inkMuted, fontSize: 11, letterSpacing: 0.5 }}>LAST WORD</Text>
|
|
11
|
+
<Text selectable style={{ color: PAPER.ink, fontSize: 13, lineHeight: 19, flexShrink: 1 }}>{text}</Text>
|
|
12
|
+
</PaperCard>
|
|
27
13
|
);
|
|
28
14
|
}
|