@haklex/rich-renderer-mention 0.0.4 → 0.0.6

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":"MentionRenderer.d.ts","sourceRoot":"","sources":["../src/MentionRenderer.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CACnC;AAYD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAsB/D,CAAA;AAED,eAAO,MAAM,YAAY,UAA+B,CAAA;AAExD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,WAAW,GACZ,EAAE,oBAAoB,2CAmCtB"}
1
+ {"version":3,"file":"MentionRenderer.d.ts","sourceRoot":"","sources":["../src/MentionRenderer.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CACnC;AAYD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAsB/D,CAAA;AAED,eAAO,MAAM,YAAY,UAA+B,CAAA;AAExD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,WAAW,GACZ,EAAE,oBAAoB,2CAuCtB"}
package/dist/index.mjs CHANGED
@@ -63,35 +63,47 @@ function MentionRenderer({
63
63
  const meta = platformMetaMap[platform];
64
64
  const label = displayName || normalizedHandle;
65
65
  if (meta) {
66
- return /* @__PURE__ */ jsxs("span", { className: `${mention} ${semanticClassNames.mention}`, children: [
67
- /* @__PURE__ */ jsx(
68
- "span",
69
- {
70
- className: `${mentionIcon} ${semanticClassNames.mentionIcon}`,
71
- "aria-hidden": true,
72
- children: meta.icon
73
- }
74
- ),
75
- /* @__PURE__ */ jsx(
76
- "a",
77
- {
78
- className: `${mentionHandle} ${semanticClassNames.mentionHandle}`,
79
- href: meta.getUrl(normalizedHandle),
80
- target: "_blank",
81
- rel: "noopener noreferrer",
82
- children: label
83
- }
84
- )
85
- ] });
66
+ return /* @__PURE__ */ jsxs(
67
+ "span",
68
+ {
69
+ className: `${mention} ${semanticClassNames.mention}`,
70
+ children: [
71
+ /* @__PURE__ */ jsx(
72
+ "span",
73
+ {
74
+ className: `${mentionIcon} ${semanticClassNames.mentionIcon}`,
75
+ "aria-hidden": true,
76
+ children: meta.icon
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsx(
80
+ "a",
81
+ {
82
+ className: `${mentionHandle} ${semanticClassNames.mentionHandle}`,
83
+ href: meta.getUrl(normalizedHandle),
84
+ target: "_blank",
85
+ rel: "noopener noreferrer",
86
+ children: label
87
+ }
88
+ )
89
+ ]
90
+ }
91
+ );
86
92
  }
87
93
  return /* @__PURE__ */ jsx(
88
94
  "span",
89
95
  {
90
96
  className: `${mention} ${semanticClassNames.mention} ${mentionPlain} ${semanticClassNames.mentionPlain}`,
91
- children: /* @__PURE__ */ jsxs("span", { className: `${mentionHandle} ${semanticClassNames.mentionHandle}`, children: [
92
- "@",
93
- label
94
- ] })
97
+ children: /* @__PURE__ */ jsxs(
98
+ "span",
99
+ {
100
+ className: `${mentionHandle} ${semanticClassNames.mentionHandle}`,
101
+ children: [
102
+ "@",
103
+ label
104
+ ]
105
+ }
106
+ )
95
107
  }
96
108
  );
97
109
  }
@@ -220,93 +232,117 @@ function MentionEditRendererInner({
220
232
  sideOffset: 8,
221
233
  className: `${editPanel} ${semanticClassNames.editPanel}`,
222
234
  children: [
223
- /* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
224
- /* @__PURE__ */ jsx(
225
- "span",
226
- {
227
- className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
228
- style: { fontSize: 14 },
229
- "aria-hidden": true,
230
- children: platformMetaMap[editPlatform]?.icon ?? /* @__PURE__ */ jsx(AtSign, { size: 14 })
231
- }
232
- ),
233
- /* @__PURE__ */ jsx(
234
- "select",
235
- {
236
- className: `${editSelect} ${semanticClassNames.editSelect}`,
237
- value: editPlatform,
238
- onChange: (e) => setEditPlatform(e.target.value),
239
- children: platformKeys.map((key) => /* @__PURE__ */ jsx("option", { value: key, children: platformMetaMap[key].label }, key))
240
- }
241
- )
242
- ] }),
243
- /* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
244
- /* @__PURE__ */ jsx(
245
- AtSign,
246
- {
247
- className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
248
- size: 14
249
- }
250
- ),
251
- /* @__PURE__ */ jsx(
252
- "input",
253
- {
254
- className: `${editInput} ${semanticClassNames.editInput}`,
255
- type: "text",
256
- value: editHandle,
257
- onChange: (e) => setEditHandle(e.target.value),
258
- onKeyDown: handleKeyDown,
259
- placeholder: "handle"
260
- }
261
- )
262
- ] }),
263
- /* @__PURE__ */ jsxs("div", { className: `${editField} ${semanticClassNames.editField}`, children: [
264
- /* @__PURE__ */ jsx(
265
- User,
266
- {
267
- className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
268
- size: 14
269
- }
270
- ),
271
- /* @__PURE__ */ jsx(
272
- "input",
273
- {
274
- className: `${editInput} ${semanticClassNames.editInput}`,
275
- type: "text",
276
- value: editDisplayName,
277
- onChange: (e) => setEditDisplayName(e.target.value),
278
- onBlur: commitChanges,
279
- onKeyDown: handleKeyDown,
280
- placeholder: "Display name (optional)"
281
- }
282
- )
283
- ] }),
284
- /* @__PURE__ */ jsxs("div", { className: `${editActions} ${semanticClassNames.editActions}`, children: [
285
- /* @__PURE__ */ jsxs(
286
- "button",
287
- {
288
- className: `${editActionButton} ${semanticClassNames.editActionButton}`,
289
- type: "button",
290
- onClick: handleOpen,
291
- children: [
292
- /* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
293
- "Open"
294
- ]
295
- }
296
- ),
297
- /* @__PURE__ */ jsxs(
298
- "button",
299
- {
300
- className: `${editActionButton} ${semanticClassNames.editActionButton} ${editActionButtonEnd} ${semanticClassNames.editActionButtonEnd}`,
301
- type: "button",
302
- onClick: handleDelete,
303
- children: [
304
- /* @__PURE__ */ jsx(Trash2, { size: 14 }),
305
- "Remove"
306
- ]
307
- }
308
- )
309
- ] })
235
+ /* @__PURE__ */ jsxs(
236
+ "div",
237
+ {
238
+ className: `${editField} ${semanticClassNames.editField}`,
239
+ children: [
240
+ /* @__PURE__ */ jsx(
241
+ "span",
242
+ {
243
+ className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
244
+ style: { fontSize: 14 },
245
+ "aria-hidden": true,
246
+ children: platformMetaMap[editPlatform]?.icon ?? /* @__PURE__ */ jsx(AtSign, { size: 14 })
247
+ }
248
+ ),
249
+ /* @__PURE__ */ jsx(
250
+ "select",
251
+ {
252
+ className: `${editSelect} ${semanticClassNames.editSelect}`,
253
+ value: editPlatform,
254
+ onChange: (e) => setEditPlatform(e.target.value),
255
+ children: platformKeys.map((key) => /* @__PURE__ */ jsx("option", { value: key, children: platformMetaMap[key].label }, key))
256
+ }
257
+ )
258
+ ]
259
+ }
260
+ ),
261
+ /* @__PURE__ */ jsxs(
262
+ "div",
263
+ {
264
+ className: `${editField} ${semanticClassNames.editField}`,
265
+ children: [
266
+ /* @__PURE__ */ jsx(
267
+ AtSign,
268
+ {
269
+ className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
270
+ size: 14
271
+ }
272
+ ),
273
+ /* @__PURE__ */ jsx(
274
+ "input",
275
+ {
276
+ className: `${editInput} ${semanticClassNames.editInput}`,
277
+ type: "text",
278
+ value: editHandle,
279
+ onChange: (e) => setEditHandle(e.target.value),
280
+ onKeyDown: handleKeyDown,
281
+ placeholder: "handle"
282
+ }
283
+ )
284
+ ]
285
+ }
286
+ ),
287
+ /* @__PURE__ */ jsxs(
288
+ "div",
289
+ {
290
+ className: `${editField} ${semanticClassNames.editField}`,
291
+ children: [
292
+ /* @__PURE__ */ jsx(
293
+ User,
294
+ {
295
+ className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
296
+ size: 14
297
+ }
298
+ ),
299
+ /* @__PURE__ */ jsx(
300
+ "input",
301
+ {
302
+ className: `${editInput} ${semanticClassNames.editInput}`,
303
+ type: "text",
304
+ value: editDisplayName,
305
+ onChange: (e) => setEditDisplayName(e.target.value),
306
+ onBlur: commitChanges,
307
+ onKeyDown: handleKeyDown,
308
+ placeholder: "Display name (optional)"
309
+ }
310
+ )
311
+ ]
312
+ }
313
+ ),
314
+ /* @__PURE__ */ jsxs(
315
+ "div",
316
+ {
317
+ className: `${editActions} ${semanticClassNames.editActions}`,
318
+ children: [
319
+ /* @__PURE__ */ jsxs(
320
+ "button",
321
+ {
322
+ className: `${editActionButton} ${semanticClassNames.editActionButton}`,
323
+ type: "button",
324
+ onClick: handleOpen,
325
+ children: [
326
+ /* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
327
+ "Open"
328
+ ]
329
+ }
330
+ ),
331
+ /* @__PURE__ */ jsxs(
332
+ "button",
333
+ {
334
+ className: `${editActionButton} ${semanticClassNames.editActionButton} ${editActionButtonEnd} ${semanticClassNames.editActionButtonEnd}`,
335
+ type: "button",
336
+ onClick: handleDelete,
337
+ children: [
338
+ /* @__PURE__ */ jsx(Trash2, { size: 14 }),
339
+ "Remove"
340
+ ]
341
+ }
342
+ )
343
+ ]
344
+ }
345
+ )
310
346
  ]
311
347
  }
312
348
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-renderer-mention",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Social mention renderer with platform badges",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,17 +18,17 @@
18
18
  "dependencies": {
19
19
  "@icons-pack/react-simple-icons": "^13.11.2",
20
20
  "lucide-react": "^0.574.0",
21
- "@haklex/rich-editor": "0.0.4",
22
- "@haklex/rich-editor-ui": "0.0.4",
23
- "@haklex/rich-style-token": "0.0.4"
21
+ "@haklex/rich-editor": "0.0.6",
22
+ "@haklex/rich-editor-ui": "0.0.6",
23
+ "@haklex/rich-style-token": "0.0.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@lexical/react": "^0.39.0",
26
+ "@lexical/react": "^0.40.0",
27
27
  "@types/react": "^19.0.0",
28
28
  "@types/react-dom": "^19.0.0",
29
29
  "@vanilla-extract/css": "^1.17.1",
30
30
  "@vanilla-extract/vite-plugin": "^4.0.20",
31
- "lexical": "^0.39.0",
31
+ "lexical": "^0.40.0",
32
32
  "react": "19.2.4",
33
33
  "react-dom": "19.2.4",
34
34
  "typescript": "^5.9.0",
@@ -36,8 +36,8 @@
36
36
  "vite-plugin-dts": "^4.5.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@lexical/react": "^0.39.0",
40
- "lexical": "^0.39.0",
39
+ "@lexical/react": "^0.40.0",
40
+ "lexical": "^0.40.0",
41
41
  "react": ">=19",
42
42
  "react-dom": ">=19"
43
43
  },