@lalternative/editor 0.9.0 → 0.10.0

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/native.js ADDED
@@ -0,0 +1,255 @@
1
+ // src/native/EditorToolbar.tsx
2
+ import { useState } from "react";
3
+ import { Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
4
+
5
+ // src/native/format.ts
6
+ var defaultNativeFormatLabels = {
7
+ bold: "Gras",
8
+ italic: "Italique",
9
+ underline: "Soulign\xE9",
10
+ strike: "Barr\xE9",
11
+ h1: "Titre 1",
12
+ h2: "Titre 2",
13
+ h3: "Titre 3",
14
+ h4: "Titre 4",
15
+ bullet: "Liste \xE0 puces",
16
+ ordered: "Liste num\xE9rot\xE9e"
17
+ };
18
+ function formatActions(labels = defaultNativeFormatLabels) {
19
+ const action = (id, glyph, shortcut, edit) => ({
20
+ id,
21
+ label: labels[id],
22
+ glyph,
23
+ shortcut,
24
+ ...edit
25
+ });
26
+ return [
27
+ action("bold", "B", "**", { wrap: "**" }),
28
+ action("italic", "I", "*", { wrap: "*" }),
29
+ action("underline", "U", "++", { wrap: "++" }),
30
+ action("strike", "S", "~~", { wrap: "~~" }),
31
+ action("h1", "H1", "#", { prefix: "# " }),
32
+ action("h2", "H2", "##", { prefix: "## " }),
33
+ action("h3", "H3", "###", { prefix: "### " }),
34
+ action("h4", "H4", "####", { prefix: "#### " }),
35
+ action("bullet", "\u2022\u2014", "-", { prefix: "- " }),
36
+ action("ordered", "1.", "1.", { prefix: "1. " })
37
+ ];
38
+ }
39
+ function applyFormat(text, selection, action) {
40
+ const { start, end } = selection;
41
+ if (action.prefix) {
42
+ const lineStart = text.lastIndexOf("\n", start - 1) + 1;
43
+ const shift = action.prefix.length;
44
+ return {
45
+ text: text.slice(0, lineStart) + action.prefix + text.slice(lineStart),
46
+ selection: { start: start + shift, end: end + shift }
47
+ };
48
+ }
49
+ const wrap = action.wrap ?? "";
50
+ return {
51
+ text: text.slice(0, start) + wrap + text.slice(start, end) + wrap + text.slice(end),
52
+ selection: { start: start + wrap.length, end: end + wrap.length }
53
+ };
54
+ }
55
+
56
+ // src/native/theme.ts
57
+ var defaultEditorToolbarTheme = {
58
+ surface: "#ffffff",
59
+ text: "#111827",
60
+ muted: "rgba(17, 24, 39, 0.5)",
61
+ border: "rgba(0, 0, 0, 0.1)",
62
+ pressed: "rgba(0, 0, 0, 0.06)",
63
+ accent: "#1d4ed8",
64
+ backdrop: "rgba(0, 0, 0, 0.4)"
65
+ };
66
+
67
+ // src/native/EditorToolbar.tsx
68
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
69
+ function glyphStyle(action) {
70
+ switch (action.id) {
71
+ case "bold":
72
+ return { fontSize: 17, fontWeight: "700" };
73
+ case "italic":
74
+ return { fontSize: 17, fontStyle: "italic", fontWeight: "500" };
75
+ case "underline":
76
+ return { fontSize: 17, fontWeight: "500", textDecorationLine: "underline" };
77
+ case "strike":
78
+ return { fontSize: 17, fontWeight: "500", textDecorationLine: "line-through" };
79
+ case "h1":
80
+ case "h2":
81
+ case "h3":
82
+ case "h4":
83
+ return { fontSize: 14, fontWeight: "600" };
84
+ default:
85
+ return { fontSize: 15, fontWeight: "500" };
86
+ }
87
+ }
88
+ function EditorToolbar({
89
+ onFormat,
90
+ actions = formatActions(),
91
+ children,
92
+ renderPanel,
93
+ panelOpen = false,
94
+ onPanelClose,
95
+ bottom = 0,
96
+ theme = defaultEditorToolbarTheme,
97
+ formatLabel = "Aa",
98
+ backLabel = "\u2039",
99
+ onPressFeedback
100
+ }) {
101
+ const [formatOpen, setFormatOpen] = useState(false);
102
+ const pill = [styles.pill, { backgroundColor: theme.surface, borderColor: theme.border }];
103
+ const pressed = ({ pressed: pressed2 }) => [styles.icon, pressed2 && styles.pressed];
104
+ const back = (onPress) => /* @__PURE__ */ jsxs(Fragment, { children: [
105
+ /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress, style: pressed, children: /* @__PURE__ */ jsx(Text, { style: [styles.back, { color: theme.muted }], children: backLabel }) }),
106
+ /* @__PURE__ */ jsx(View, { style: [styles.divider, { backgroundColor: theme.border }] })
107
+ ] });
108
+ if (panelOpen && renderPanel) {
109
+ return /* @__PURE__ */ jsx(View, { style: [styles.wrap, { bottom }], children: renderPanel({ close: () => onPanelClose?.() }) });
110
+ }
111
+ return /* @__PURE__ */ jsx(View, { style: [styles.wrap, { bottom }], children: /* @__PURE__ */ jsx(View, { style: styles.pillRow, children: /* @__PURE__ */ jsx(View, { style: pill, children: formatOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
112
+ back(() => setFormatOpen(false)),
113
+ /* @__PURE__ */ jsx(
114
+ ScrollView,
115
+ {
116
+ horizontal: true,
117
+ showsHorizontalScrollIndicator: false,
118
+ keyboardShouldPersistTaps: "always",
119
+ contentContainerStyle: styles.formatRow,
120
+ children: actions.map((action) => /* @__PURE__ */ jsx(
121
+ Pressable,
122
+ {
123
+ accessibilityRole: "button",
124
+ accessibilityLabel: action.label,
125
+ onPress: () => {
126
+ onPressFeedback?.();
127
+ onFormat(action);
128
+ },
129
+ style: pressed,
130
+ children: /* @__PURE__ */ jsx(Text, { style: [glyphStyle(action), { color: theme.text }], children: action.glyph })
131
+ },
132
+ action.id
133
+ ))
134
+ }
135
+ )
136
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
137
+ /* @__PURE__ */ jsx(
138
+ Pressable,
139
+ {
140
+ accessibilityRole: "button",
141
+ onPress: () => {
142
+ onPressFeedback?.();
143
+ setFormatOpen(true);
144
+ },
145
+ style: pressed,
146
+ children: /* @__PURE__ */ jsx(Text, { style: [styles.aa, { color: theme.text }], children: formatLabel })
147
+ }
148
+ ),
149
+ children
150
+ ] }) }) }) });
151
+ }
152
+ function EditorToolbarButton({
153
+ onPress,
154
+ label,
155
+ disabled,
156
+ children
157
+ }) {
158
+ return /* @__PURE__ */ jsx(
159
+ Pressable,
160
+ {
161
+ accessibilityRole: "button",
162
+ accessibilityLabel: label,
163
+ disabled,
164
+ onPress,
165
+ style: ({ pressed }) => [styles.icon, (pressed || disabled) && styles.pressed],
166
+ children
167
+ }
168
+ );
169
+ }
170
+ var styles = StyleSheet.create({
171
+ // Android stacks by elevation, not zIndex: without it the bar renders under
172
+ // the ScrollView it overlays.
173
+ wrap: { position: "absolute", left: 0, right: 0, zIndex: 10, elevation: 10 },
174
+ pillRow: { alignItems: "center", paddingHorizontal: 16 },
175
+ pill: {
176
+ maxWidth: "100%",
177
+ flexDirection: "row",
178
+ alignItems: "center",
179
+ gap: 4,
180
+ paddingHorizontal: 8,
181
+ paddingVertical: 4,
182
+ borderRadius: 999,
183
+ borderWidth: StyleSheet.hairlineWidth,
184
+ shadowColor: "#000",
185
+ shadowOpacity: 0.12,
186
+ shadowRadius: 8,
187
+ shadowOffset: { width: 0, height: 3 }
188
+ },
189
+ formatRow: { alignItems: "center" },
190
+ icon: { width: 40, height: 36, alignItems: "center", justifyContent: "center", borderRadius: 999 },
191
+ pressed: { opacity: 0.5 },
192
+ aa: { fontSize: 17, fontWeight: "500" },
193
+ back: { fontSize: 22, fontWeight: "400" },
194
+ divider: { width: StyleSheet.hairlineWidth, height: 20, marginHorizontal: 2 }
195
+ });
196
+
197
+ // src/native/FormatSheet.tsx
198
+ import { KeyboardAvoidingView, Modal, Platform, Pressable as Pressable2, StyleSheet as StyleSheet2, Text as Text2, View as View2 } from "react-native";
199
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
200
+ function FormatSheet({
201
+ visible,
202
+ onClose,
203
+ onPick,
204
+ actions = formatActions(),
205
+ theme = defaultEditorToolbarTheme
206
+ }) {
207
+ return /* @__PURE__ */ jsxs2(Modal, { visible, animationType: "slide", transparent: true, onRequestClose: onClose, children: [
208
+ /* @__PURE__ */ jsx2(Pressable2, { style: [styles2.backdrop, { backgroundColor: theme.backdrop }], onPress: onClose }),
209
+ /* @__PURE__ */ jsx2(
210
+ KeyboardAvoidingView,
211
+ {
212
+ behavior: Platform.OS === "ios" ? "padding" : void 0,
213
+ style: styles2.sheetWrapper,
214
+ pointerEvents: "box-none",
215
+ children: /* @__PURE__ */ jsxs2(View2, { style: [styles2.sheet, { backgroundColor: theme.surface }], children: [
216
+ /* @__PURE__ */ jsx2(View2, { style: [styles2.handle, { backgroundColor: theme.border }] }),
217
+ actions.map((action) => /* @__PURE__ */ jsxs2(
218
+ Pressable2,
219
+ {
220
+ accessibilityRole: "button",
221
+ onPress: () => onPick(action),
222
+ style: ({ pressed }) => [styles2.row, pressed && { backgroundColor: theme.pressed }],
223
+ children: [
224
+ /* @__PURE__ */ jsx2(Text2, { style: [styles2.glyph, { color: theme.muted }], children: action.glyph }),
225
+ /* @__PURE__ */ jsx2(Text2, { style: [styles2.label, { color: theme.text }], children: action.label }),
226
+ /* @__PURE__ */ jsx2(Text2, { style: [styles2.shortcut, { color: theme.muted, backgroundColor: theme.pressed }], children: action.shortcut })
227
+ ]
228
+ },
229
+ action.id
230
+ ))
231
+ ] })
232
+ }
233
+ )
234
+ ] });
235
+ }
236
+ var styles2 = StyleSheet2.create({
237
+ backdrop: { ...StyleSheet2.absoluteFillObject },
238
+ sheetWrapper: { flex: 1, justifyContent: "flex-end" },
239
+ sheet: { borderTopLeftRadius: 20, borderTopRightRadius: 20, paddingHorizontal: 8, paddingBottom: 40 },
240
+ handle: { alignSelf: "center", width: 40, height: 4, borderRadius: 999, marginTop: 8, marginBottom: 12 },
241
+ row: { flexDirection: "row", alignItems: "center", gap: 12, paddingHorizontal: 12, paddingVertical: 12, borderRadius: 10 },
242
+ glyph: { width: 24, fontSize: 14, fontWeight: "600", textAlign: "center" },
243
+ label: { flex: 1, fontSize: 15 },
244
+ shortcut: { fontSize: 12, fontFamily: Platform.OS === "ios" ? "Menlo" : "monospace", paddingHorizontal: 6, paddingVertical: 2, borderRadius: 4, overflow: "hidden" }
245
+ });
246
+ export {
247
+ EditorToolbar,
248
+ EditorToolbarButton,
249
+ FormatSheet,
250
+ applyFormat,
251
+ defaultEditorToolbarTheme,
252
+ defaultNativeFormatLabels,
253
+ formatActions
254
+ };
255
+ //# sourceMappingURL=native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/native/EditorToolbar.tsx","../src/native/format.ts","../src/native/theme.ts","../src/native/FormatSheet.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { Pressable, ScrollView, StyleSheet, Text, View, type TextStyle } from \"react-native\";\n\nimport { formatActions, type FormatAction } from \"./format\";\nimport { defaultEditorToolbarTheme, type EditorToolbarTheme } from \"./theme\";\n\nexport interface EditorToolbarControls {\n close: () => void;\n}\n\nexport interface EditorToolbarProps {\n onFormat: (action: FormatAction) => void;\n actions?: FormatAction[];\n /** Buttons the host adds after the format toggle: dictation, assistant, save. */\n children?: React.ReactNode;\n /** A host panel shown in place of the bar while `panelOpen` is true. */\n renderPanel?: (controls: EditorToolbarControls) => React.ReactNode;\n panelOpen?: boolean;\n onPanelClose?: () => void;\n bottom?: number;\n theme?: EditorToolbarTheme;\n formatLabel?: string;\n backLabel?: string;\n onPressFeedback?: () => void;\n}\n\nfunction glyphStyle(action: FormatAction): TextStyle {\n switch (action.id) {\n case \"bold\":\n return { fontSize: 17, fontWeight: \"700\" };\n case \"italic\":\n return { fontSize: 17, fontStyle: \"italic\", fontWeight: \"500\" };\n case \"underline\":\n return { fontSize: 17, fontWeight: \"500\", textDecorationLine: \"underline\" };\n case \"strike\":\n return { fontSize: 17, fontWeight: \"500\", textDecorationLine: \"line-through\" };\n case \"h1\":\n case \"h2\":\n case \"h3\":\n case \"h4\":\n return { fontSize: 14, fontWeight: \"600\" };\n default:\n return { fontSize: 15, fontWeight: \"500\" };\n }\n}\n\nexport function EditorToolbar({\n onFormat,\n actions = formatActions(),\n children,\n renderPanel,\n panelOpen = false,\n onPanelClose,\n bottom = 0,\n theme = defaultEditorToolbarTheme,\n formatLabel = \"Aa\",\n backLabel = \"‹\",\n onPressFeedback,\n}: EditorToolbarProps) {\n const [formatOpen, setFormatOpen] = useState(false);\n const pill = [styles.pill, { backgroundColor: theme.surface, borderColor: theme.border }];\n const pressed = ({ pressed }: { pressed: boolean }) => [styles.icon, pressed && styles.pressed];\n\n const back = (onPress: () => void) => (\n <>\n <Pressable accessibilityRole=\"button\" onPress={onPress} style={pressed}>\n <Text style={[styles.back, { color: theme.muted }]}>{backLabel}</Text>\n </Pressable>\n <View style={[styles.divider, { backgroundColor: theme.border }]} />\n </>\n );\n\n if (panelOpen && renderPanel) {\n return (\n <View style={[styles.wrap, { bottom }]}>\n {renderPanel({ close: () => onPanelClose?.() })}\n </View>\n );\n }\n\n return (\n <View style={[styles.wrap, { bottom }]}>\n <View style={styles.pillRow}>\n <View style={pill}>\n {formatOpen ? (\n <>\n {back(() => setFormatOpen(false))}\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n keyboardShouldPersistTaps=\"always\"\n contentContainerStyle={styles.formatRow}\n >\n {actions.map((action) => (\n <Pressable\n key={action.id}\n accessibilityRole=\"button\"\n accessibilityLabel={action.label}\n onPress={() => {\n onPressFeedback?.();\n onFormat(action);\n }}\n style={pressed}\n >\n <Text style={[glyphStyle(action), { color: theme.text }]}>{action.glyph}</Text>\n </Pressable>\n ))}\n </ScrollView>\n </>\n ) : (\n <>\n <Pressable\n accessibilityRole=\"button\"\n onPress={() => {\n onPressFeedback?.();\n setFormatOpen(true);\n }}\n style={pressed}\n >\n <Text style={[styles.aa, { color: theme.text }]}>{formatLabel}</Text>\n </Pressable>\n {children}\n </>\n )}\n </View>\n </View>\n </View>\n );\n}\n\nexport function EditorToolbarButton({\n onPress,\n label,\n disabled,\n children,\n}: {\n onPress: () => void;\n label: string;\n disabled?: boolean;\n children: React.ReactNode;\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={label}\n disabled={disabled}\n onPress={onPress}\n style={({ pressed }) => [styles.icon, (pressed || disabled) && styles.pressed]}\n >\n {children}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n // Android stacks by elevation, not zIndex: without it the bar renders under\n // the ScrollView it overlays.\n wrap: { position: \"absolute\", left: 0, right: 0, zIndex: 10, elevation: 10 },\n pillRow: { alignItems: \"center\", paddingHorizontal: 16 },\n pill: {\n maxWidth: \"100%\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 4,\n paddingHorizontal: 8,\n paddingVertical: 4,\n borderRadius: 999,\n borderWidth: StyleSheet.hairlineWidth,\n shadowColor: \"#000\",\n shadowOpacity: 0.12,\n shadowRadius: 8,\n shadowOffset: { width: 0, height: 3 },\n },\n formatRow: { alignItems: \"center\" },\n icon: { width: 40, height: 36, alignItems: \"center\", justifyContent: \"center\", borderRadius: 999 },\n pressed: { opacity: 0.5 },\n aa: { fontSize: 17, fontWeight: \"500\" },\n back: { fontSize: 22, fontWeight: \"400\" },\n divider: { width: StyleSheet.hairlineWidth, height: 20, marginHorizontal: 2 },\n});\n","export type FormatActionId =\n | \"bold\"\n | \"italic\"\n | \"underline\"\n | \"strike\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"bullet\"\n | \"ordered\";\n\nexport interface FormatAction {\n id: FormatActionId;\n label: string;\n glyph: string;\n /** The markdown the action writes, shown as its shortcut. */\n shortcut: string;\n prefix?: string;\n wrap?: string;\n}\n\nexport type NativeFormatLabels = Record<FormatActionId, string>;\n\nexport const defaultNativeFormatLabels: NativeFormatLabels = {\n bold: \"Gras\",\n italic: \"Italique\",\n underline: \"Souligné\",\n strike: \"Barré\",\n h1: \"Titre 1\",\n h2: \"Titre 2\",\n h3: \"Titre 3\",\n h4: \"Titre 4\",\n bullet: \"Liste à puces\",\n ordered: \"Liste numérotée\",\n};\n\nexport function formatActions(labels: NativeFormatLabels = defaultNativeFormatLabels): FormatAction[] {\n const action = (id: FormatActionId, glyph: string, shortcut: string, edit: Pick<FormatAction, \"prefix\" | \"wrap\">) => ({\n id,\n label: labels[id],\n glyph,\n shortcut,\n ...edit,\n });\n return [\n action(\"bold\", \"B\", \"**\", { wrap: \"**\" }),\n action(\"italic\", \"I\", \"*\", { wrap: \"*\" }),\n action(\"underline\", \"U\", \"++\", { wrap: \"++\" }),\n action(\"strike\", \"S\", \"~~\", { wrap: \"~~\" }),\n action(\"h1\", \"H1\", \"#\", { prefix: \"# \" }),\n action(\"h2\", \"H2\", \"##\", { prefix: \"## \" }),\n action(\"h3\", \"H3\", \"###\", { prefix: \"### \" }),\n action(\"h4\", \"H4\", \"####\", { prefix: \"#### \" }),\n action(\"bullet\", \"•—\", \"-\", { prefix: \"- \" }),\n action(\"ordered\", \"1.\", \"1.\", { prefix: \"1. \" }),\n ];\n}\n\nexport interface TextSelection {\n start: number;\n end: number;\n}\n\nexport interface FormattedText {\n text: string;\n selection: TextSelection;\n}\n\n/** applyFormat writes an action into a plain-text field, for hosts without a rich editor. */\nexport function applyFormat(text: string, selection: TextSelection, action: FormatAction): FormattedText {\n const { start, end } = selection;\n if (action.prefix) {\n const lineStart = text.lastIndexOf(\"\\n\", start - 1) + 1;\n const shift = action.prefix.length;\n return {\n text: text.slice(0, lineStart) + action.prefix + text.slice(lineStart),\n selection: { start: start + shift, end: end + shift },\n };\n }\n const wrap = action.wrap ?? \"\";\n return {\n text: text.slice(0, start) + wrap + text.slice(start, end) + wrap + text.slice(end),\n selection: { start: start + wrap.length, end: end + wrap.length },\n };\n}\n","export interface EditorToolbarTheme {\n surface: string;\n text: string;\n muted: string;\n border: string;\n pressed: string;\n accent: string;\n backdrop: string;\n}\n\nexport const defaultEditorToolbarTheme: EditorToolbarTheme = {\n surface: \"#ffffff\",\n text: \"#111827\",\n muted: \"rgba(17, 24, 39, 0.5)\",\n border: \"rgba(0, 0, 0, 0.1)\",\n pressed: \"rgba(0, 0, 0, 0.06)\",\n accent: \"#1d4ed8\",\n backdrop: \"rgba(0, 0, 0, 0.4)\",\n};\n","import { KeyboardAvoidingView, Modal, Platform, Pressable, StyleSheet, Text, View } from \"react-native\";\n\nimport { formatActions, type FormatAction } from \"./format\";\nimport { defaultEditorToolbarTheme, type EditorToolbarTheme } from \"./theme\";\n\nexport interface FormatSheetProps {\n visible: boolean;\n onClose: () => void;\n onPick: (action: FormatAction) => void;\n actions?: FormatAction[];\n theme?: EditorToolbarTheme;\n}\n\nexport function FormatSheet({\n visible,\n onClose,\n onPick,\n actions = formatActions(),\n theme = defaultEditorToolbarTheme,\n}: FormatSheetProps) {\n return (\n <Modal visible={visible} animationType=\"slide\" transparent onRequestClose={onClose}>\n <Pressable style={[styles.backdrop, { backgroundColor: theme.backdrop }]} onPress={onClose} />\n <KeyboardAvoidingView\n behavior={Platform.OS === \"ios\" ? \"padding\" : undefined}\n style={styles.sheetWrapper}\n pointerEvents=\"box-none\"\n >\n <View style={[styles.sheet, { backgroundColor: theme.surface }]}>\n <View style={[styles.handle, { backgroundColor: theme.border }]} />\n {actions.map((action) => (\n <Pressable\n key={action.id}\n accessibilityRole=\"button\"\n onPress={() => onPick(action)}\n style={({ pressed }) => [styles.row, pressed && { backgroundColor: theme.pressed }]}\n >\n <Text style={[styles.glyph, { color: theme.muted }]}>{action.glyph}</Text>\n <Text style={[styles.label, { color: theme.text }]}>{action.label}</Text>\n <Text style={[styles.shortcut, { color: theme.muted, backgroundColor: theme.pressed }]}>\n {action.shortcut}\n </Text>\n </Pressable>\n ))}\n </View>\n </KeyboardAvoidingView>\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n backdrop: { ...StyleSheet.absoluteFillObject },\n sheetWrapper: { flex: 1, justifyContent: \"flex-end\" },\n sheet: { borderTopLeftRadius: 20, borderTopRightRadius: 20, paddingHorizontal: 8, paddingBottom: 40 },\n handle: { alignSelf: \"center\", width: 40, height: 4, borderRadius: 999, marginTop: 8, marginBottom: 12 },\n row: { flexDirection: \"row\", alignItems: \"center\", gap: 12, paddingHorizontal: 12, paddingVertical: 12, borderRadius: 10 },\n glyph: { width: 24, fontSize: 14, fontWeight: \"600\", textAlign: \"center\" },\n label: { flex: 1, fontSize: 15 },\n shortcut: { fontSize: 12, fontFamily: Platform.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AAO,QAAQ,UAAU,aAAa,mBAAmB,GAAG,iBAAiB,GAAG,cAAc,GAAG,UAAU,SAAS;AACrK,CAAC;","names":["pressed","Pressable","StyleSheet","Text","View","jsx","jsxs","Pressable","styles","View","Text","StyleSheet"]}
@@ -1,5 +1,5 @@
1
- import { B as BlockChange, R as RichDoc } from './diff-uFiP8hD5.js';
2
- export { C as ChangeKind } from './diff-uFiP8hD5.js';
1
+ import { B as BlockChange, R as RichDoc } from './diff-9dRTXeJa.js';
2
+ export { C as ChangeKind } from './diff-9dRTXeJa.js';
3
3
 
4
4
  type Decision = "pending" | "accepted" | "rejected";
5
5
  interface RevisionState {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lalternative/editor",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Shared TipTap editor for L'Alternative apps: rich text, format menu, selection toolbar and inline AI revisions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -63,8 +63,7 @@
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",
66
- "url": "https://github.com/lalternative/packages.git",
67
- "directory": "editor"
66
+ "url": "https://github.com/lalternativefabrique/editorkit.git"
68
67
  },
69
68
  "peerDependenciesMeta": {
70
69
  "@tiptap/starter-kit": {
@@ -76,5 +75,6 @@
76
75
  "react-native": {
77
76
  "optional": true
78
77
  }
79
- }
78
+ },
79
+ "license": "MPL-2.0"
80
80
  }