@burdenoff/microfe-planmagnet 2026.719.2 → 2026.720.1
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/components/MarkdownEditor.d.ts +10 -0
- package/dist/components/MarkdownEditor.d.ts.map +1 -0
- package/dist/components/MarkdownEditor.js +98 -0
- package/dist/components/MarkdownEditor.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +252 -515
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-types.d.ts +2334 -2867
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsEditReleasePagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsEditReleasePagePage.js +103 -106
- package/dist/planmagnet/pages/ProductsEditReleasePagePage.js.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.d.ts.map +1 -1
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js +41 -40
- package/dist/planmagnet/pages/ProductsReleaseDetailPagePage.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface MarkdownEditorProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
minHeight?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function MarkdownEditor({ value, onChange, label, placeholder, minHeight, className, }: MarkdownEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=MarkdownEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownEditor.d.ts","sourceRoot":"","sources":["../../src/components/MarkdownEditor.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,KAAK,EACL,WAAW,EACX,SAAe,EACf,SAAc,GACf,EAAE,mBAAmB,2CAsGrB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
import { Bold as t, Code as n, Italic as r, Link as i, List as a } from "lucide-react";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
import { Markdown as c } from "@burdenoff/fe-libs/shared/components";
|
|
5
|
+
//#region src/components/MarkdownEditor.tsx
|
|
6
|
+
function l({ value: l, onChange: u, label: d, placeholder: f, minHeight: p = 120, className: m = "" }) {
|
|
7
|
+
let [h, g] = e("write"), [_, v] = e(null), y = (e, t, n = "") => {
|
|
8
|
+
if (!_) return;
|
|
9
|
+
let r = _.selectionStart ?? 0, i = _.selectionEnd ?? 0, a = l.slice(r, i), o = a.length > 0 ? `${e}${a}${t}` : `${e}${n}${t}`;
|
|
10
|
+
u(l.slice(0, r) + o + l.slice(i)), requestAnimationFrame(() => {
|
|
11
|
+
_.focus();
|
|
12
|
+
let t = a.length > 0 ? o.length : e.length + n.length;
|
|
13
|
+
_.setSelectionRange(r + t, r + t);
|
|
14
|
+
});
|
|
15
|
+
}, b = [
|
|
16
|
+
{
|
|
17
|
+
icon: t,
|
|
18
|
+
label: "Bold",
|
|
19
|
+
action: () => y("**", "**", "bold text")
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
icon: r,
|
|
23
|
+
label: "Italic",
|
|
24
|
+
action: () => y("_", "_", "italic text")
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
icon: i,
|
|
28
|
+
label: "Link",
|
|
29
|
+
action: () => y("[", "](url)", "link text")
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
icon: n,
|
|
33
|
+
label: "Code",
|
|
34
|
+
action: () => y("`", "`", "code")
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
icon: a,
|
|
38
|
+
label: "List",
|
|
39
|
+
action: () => y("\n- ", "", "list item")
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
return /* @__PURE__ */ s("div", {
|
|
43
|
+
className: `space-y-2 ${m}`,
|
|
44
|
+
children: [d && /* @__PURE__ */ o("label", {
|
|
45
|
+
className: "text-sm font-medium",
|
|
46
|
+
children: d
|
|
47
|
+
}), /* @__PURE__ */ s("div", {
|
|
48
|
+
className: "rounded-md border border-input bg-background overflow-hidden",
|
|
49
|
+
children: [/* @__PURE__ */ s("div", {
|
|
50
|
+
className: "flex items-center justify-between border-b border-input px-2 py-1",
|
|
51
|
+
children: [/* @__PURE__ */ o("div", {
|
|
52
|
+
className: "flex items-center gap-1",
|
|
53
|
+
children: b.map((e) => /* @__PURE__ */ o("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
onClick: e.action,
|
|
56
|
+
title: e.label,
|
|
57
|
+
className: "inline-flex items-center justify-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",
|
|
58
|
+
children: /* @__PURE__ */ o(e.icon, { className: "h-4 w-4" })
|
|
59
|
+
}, e.label))
|
|
60
|
+
}), /* @__PURE__ */ s("div", {
|
|
61
|
+
className: "flex items-center gap-1",
|
|
62
|
+
children: [/* @__PURE__ */ o("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
onClick: () => g("write"),
|
|
65
|
+
className: `rounded px-2.5 py-1 text-xs font-medium transition-colors ${h === "write" ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"}`,
|
|
66
|
+
children: "Write"
|
|
67
|
+
}), /* @__PURE__ */ o("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
onClick: () => g("preview"),
|
|
70
|
+
className: `rounded px-2.5 py-1 text-xs font-medium transition-colors ${h === "preview" ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"}`,
|
|
71
|
+
children: "Preview"
|
|
72
|
+
})]
|
|
73
|
+
})]
|
|
74
|
+
}), /* @__PURE__ */ o("div", {
|
|
75
|
+
className: "p-3",
|
|
76
|
+
children: h === "write" ? /* @__PURE__ */ o("textarea", {
|
|
77
|
+
ref: v,
|
|
78
|
+
value: l,
|
|
79
|
+
onChange: (e) => u(e.target.value),
|
|
80
|
+
placeholder: f,
|
|
81
|
+
className: "w-full resize-y bg-transparent text-sm outline-none",
|
|
82
|
+
style: { minHeight: `${p}px` }
|
|
83
|
+
}) : /* @__PURE__ */ o("div", {
|
|
84
|
+
className: "prose prose-sm dark:prose-invert max-w-none text-sm",
|
|
85
|
+
style: { minHeight: `${p}px` },
|
|
86
|
+
children: l.trim() ? /* @__PURE__ */ o(c, { children: l }) : /* @__PURE__ */ o("p", {
|
|
87
|
+
className: "text-muted-foreground italic",
|
|
88
|
+
children: "Nothing to preview."
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { l as MarkdownEditor };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=MarkdownEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownEditor.js","names":[],"sources":["../../src/components/MarkdownEditor.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { Markdown } from '@burdenoff/fe-libs/shared/components';\nimport { Bold, Italic, Link, Code, List } from 'lucide-react';\n\nexport interface MarkdownEditorProps {\n value: string;\n onChange: (value: string) => void;\n label?: string;\n placeholder?: string;\n minHeight?: number;\n className?: string;\n}\n\nexport function MarkdownEditor({\n value,\n onChange,\n label,\n placeholder,\n minHeight = 120,\n className = '',\n}: MarkdownEditorProps) {\n const [activeTab, setActiveTab] = useState<'write' | 'preview'>('write');\n const [textareaEl, setTextareaEl] = useState<HTMLTextAreaElement | null>(null);\n\n const insertSyntax = (before: string, after: string, placeholderText = '') => {\n if (!textareaEl) return;\n\n const start = textareaEl.selectionStart ?? 0;\n const end = textareaEl.selectionEnd ?? 0;\n const selected = value.slice(start, end);\n const replacement =\n selected.length > 0 ? `${before}${selected}${after}` : `${before}${placeholderText}${after}`;\n\n const nextValue = value.slice(0, start) + replacement + value.slice(end);\n onChange(nextValue);\n\n requestAnimationFrame(() => {\n textareaEl.focus();\n const cursorOffset =\n selected.length > 0 ? replacement.length : before.length + placeholderText.length;\n textareaEl.setSelectionRange(start + cursorOffset, start + cursorOffset);\n });\n };\n\n const toolbarItems = [\n { icon: Bold, label: 'Bold', action: () => insertSyntax('**', '**', 'bold text') },\n { icon: Italic, label: 'Italic', action: () => insertSyntax('_', '_', 'italic text') },\n { icon: Link, label: 'Link', action: () => insertSyntax('[', '](url)', 'link text') },\n { icon: Code, label: 'Code', action: () => insertSyntax('`', '`', 'code') },\n { icon: List, label: 'List', action: () => insertSyntax('\\n- ', '', 'list item') },\n ];\n\n return (\n <div className={`space-y-2 ${className}`}>\n {label && <label className=\"text-sm font-medium\">{label}</label>}\n <div className=\"rounded-md border border-input bg-background overflow-hidden\">\n <div className=\"flex items-center justify-between border-b border-input px-2 py-1\">\n <div className=\"flex items-center gap-1\">\n {toolbarItems.map((item) => (\n <button\n key={item.label}\n type=\"button\"\n onClick={item.action}\n title={item.label}\n className=\"inline-flex items-center justify-center rounded p-1.5 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors\"\n >\n <item.icon className=\"h-4 w-4\" />\n </button>\n ))}\n </div>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => setActiveTab('write')}\n className={`rounded px-2.5 py-1 text-xs font-medium transition-colors ${\n activeTab === 'write'\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n >\n Write\n </button>\n <button\n type=\"button\"\n onClick={() => setActiveTab('preview')}\n className={`rounded px-2.5 py-1 text-xs font-medium transition-colors ${\n activeTab === 'preview'\n ? 'bg-muted text-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n >\n Preview\n </button>\n </div>\n </div>\n\n <div className=\"p-3\">\n {activeTab === 'write' ? (\n <textarea\n ref={setTextareaEl}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={placeholder}\n className=\"w-full resize-y bg-transparent text-sm outline-none\"\n style={{ minHeight: `${minHeight}px` }}\n />\n ) : (\n <div\n className=\"prose prose-sm dark:prose-invert max-w-none text-sm\"\n style={{ minHeight: `${minHeight}px` }}\n >\n {value.trim() ? (\n <Markdown>{value}</Markdown>\n ) : (\n <p className=\"text-muted-foreground italic\">Nothing to preview.</p>\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAaA,SAAgB,EAAe,EAC7B,UACA,aACA,UACA,gBACA,eAAY,KACZ,eAAY,MACU;CACtB,IAAM,CAAC,GAAW,KAAgB,EAA8B,QAAQ,EAClE,CAAC,GAAY,KAAiB,EAAqC,KAAK,EAExE,KAAgB,GAAgB,GAAe,IAAkB,OAAO;AAC5E,MAAI,CAAC,EAAY;EAEjB,IAAM,IAAQ,EAAW,kBAAkB,GACrC,IAAM,EAAW,gBAAgB,GACjC,IAAW,EAAM,MAAM,GAAO,EAAI,EAClC,IACJ,EAAS,SAAS,IAAI,GAAG,IAAS,IAAW,MAAU,GAAG,IAAS,IAAkB;AAKvF,EAFA,EADkB,EAAM,MAAM,GAAG,EAAM,GAAG,IAAc,EAAM,MAAM,EAAI,CACrD,EAEnB,4BAA4B;AAC1B,KAAW,OAAO;GAClB,IAAM,IACJ,EAAS,SAAS,IAAI,EAAY,SAAS,EAAO,SAAS,EAAgB;AAC7E,KAAW,kBAAkB,IAAQ,GAAc,IAAQ,EAAa;IACxE;IAGE,IAAe;EACnB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