laif-ds 0.2.77 → 0.2.79
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/CHANGELOG.md +19 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/agent-docs/adoption-report.json +3 -3
- package/dist/agent-docs/components/AppEditor.md +28 -5
- package/dist/agent-docs/manifest.json +5 -4
- package/dist/components/editor/editor-ui/content-editable.js +15 -8
- package/dist/components/ui/app-editor.js +102 -83
- package/dist/components/ui/markdown-renderer.js +40 -30
- package/dist/index.d.ts +2 -1
- package/dist/node_modules/comma-separated-tokens/index.js +16 -5
- package/dist/node_modules/entities/dist/esm/decode-codepoint.js +39 -0
- package/dist/node_modules/entities/dist/esm/decode.js +246 -0
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.js +8 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-from-parse5/lib/index.js +146 -0
- package/dist/node_modules/hast-util-parse-selector/lib/index.js +21 -0
- package/dist/node_modules/hast-util-raw/lib/index.js +218 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/hast-util-to-parse5/lib/index.js +119 -0
- package/dist/node_modules/hastscript/lib/create-h.js +113 -0
- package/dist/node_modules/hastscript/lib/index.js +9 -0
- package/dist/node_modules/hastscript/lib/svg-case-sensitive-tag-names.js +45 -0
- package/dist/node_modules/parse5/dist/common/doctype.js +99 -0
- package/dist/node_modules/parse5/dist/common/error-codes.js +8 -0
- package/dist/node_modules/parse5/dist/common/foreign-content.js +211 -0
- package/dist/node_modules/parse5/dist/common/html.js +251 -0
- package/dist/node_modules/parse5/dist/common/token.js +15 -0
- package/dist/node_modules/parse5/dist/common/unicode.js +74 -0
- package/dist/node_modules/parse5/dist/parser/formatting-element-list.js +85 -0
- package/dist/node_modules/parse5/dist/parser/index.js +2272 -0
- package/dist/node_modules/parse5/dist/parser/open-element-stack.js +241 -0
- package/dist/node_modules/parse5/dist/serializer/index.js +3 -0
- package/dist/node_modules/parse5/dist/tokenizer/index.js +1941 -0
- package/dist/node_modules/parse5/dist/tokenizer/preprocessor.js +89 -0
- package/dist/node_modules/parse5/dist/tree-adapters/default.js +163 -0
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/rehype-raw/lib/index.js +13 -0
- package/dist/node_modules/space-separated-tokens/index.js +8 -3
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/vfile-location/lib/index.js +43 -0
- package/dist/node_modules/web-namespaces/index.js +12 -0
- package/dist/styles.v3.css +1 -1
- package/package.json +2 -1
package/dist/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ All notable technical changes to the laif-ds core will be documented in this fil
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [laif-ds@0.2.79]
|
|
9
|
+
|
|
10
|
+
### 🚀 Added
|
|
11
|
+
|
|
12
|
+
- **MarkdownRenderer**: Added support for raw HTML rendering via `rehype-raw`, including native `<u>...</u>` underline tags
|
|
13
|
+
- **Storybook**: Added dedicated `MarkdownRenderer` stories with underline and full-formatting examples
|
|
14
|
+
|
|
15
|
+
### 🔧 Changed
|
|
16
|
+
|
|
17
|
+
- **AppEditor**: Switched external underline markdown format from `++text++` to standard HTML `<u>text</u>` while keeping internal conversion compatibility
|
|
18
|
+
- **AppEditor**: Improved editor layout flexibility with `wrpClassName` and updated content container sizing behavior
|
|
19
|
+
- **Documentation and Stories**: Updated `AppEditor` docs and stories to reflect `<u>...</u>` underline usage
|
|
20
|
+
|
|
21
|
+
## [laif-ds@0.2.78]
|
|
22
|
+
|
|
23
|
+
### 🐛 Fixed
|
|
24
|
+
|
|
25
|
+
- **AppEditor**: Fixed missing underline text save in the component output
|
|
26
|
+
|
|
8
27
|
## [laif-ds@0.2.77]
|
|
9
28
|
|
|
10
29
|
### 🚀 Added
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
-
import { __require as
|
|
4
|
-
var
|
|
5
|
-
const
|
|
3
|
+
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
+
var r = t();
|
|
5
|
+
const m = /* @__PURE__ */ e(r);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-
|
|
3
|
+
"generatedAt": "2026-04-01T11:02:03.946Z",
|
|
4
4
|
"package": {
|
|
5
5
|
"name": "laif-ds",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.79"
|
|
7
7
|
},
|
|
8
8
|
"summary": {
|
|
9
|
-
"scannedFiles":
|
|
9
|
+
"scannedFiles": 394,
|
|
10
10
|
"deprecatedComponentsCount": 2,
|
|
11
11
|
"deprecatedComponentsUsedCount": 0,
|
|
12
12
|
"componentsWithoutExamplesCount": 5,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Rich text editor powered by Lexical with optional Markdown sync. Supports configurable toolbars (block format, font format, history), clear action, and
|
|
5
|
+
Rich text editor powered by Lexical with optional Markdown sync. Supports configurable toolbars (block format, font format, history), clear action, character counter, and extended Markdown syntax including underline support.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -23,14 +23,16 @@ Rich text editor powered by Lexical with optional Markdown sync. Supports config
|
|
|
23
23
|
## Behavior
|
|
24
24
|
|
|
25
25
|
- **Markdown sync**: When `onlyMarkdown=true`, initializes from Markdown and emits Markdown on every change.
|
|
26
|
+
- **Extended Markdown**: Supports standard Markdown plus underline syntax using `<u>text</u>` (e.g., `<u>underlined text</u>`).
|
|
26
27
|
- **Toolbars**:
|
|
27
28
|
- `history`: undo/redo toolbar.
|
|
28
|
-
- `block-format`: heading levels,
|
|
29
|
-
- `font-format`: bold
|
|
29
|
+
- `block-format`: heading levels (h1-h3), numbered/bulleted/check lists, blockquote.
|
|
30
|
+
- `font-format`: bold, italic, underline, strikethrough, inline code.
|
|
30
31
|
- **Plugins**:
|
|
31
32
|
- `clear`: clear actions in the footer.
|
|
32
33
|
- `counter`: UTF-16 character counter in the footer.
|
|
33
34
|
- **Editing**: Autosave via `onMarkdownEdit`. Keyboard navigation and selection per Lexical defaults.
|
|
35
|
+
- **Markdown Features**: Full support for headings, lists, quotes, links, inline code, bold, italic, strikethrough, and custom underline syntax.
|
|
34
36
|
|
|
35
37
|
---
|
|
36
38
|
|
|
@@ -69,7 +71,7 @@ import * as React from "react";
|
|
|
69
71
|
import { AppEditor } from "laif-ds";
|
|
70
72
|
|
|
71
73
|
export function MarkdownDefault() {
|
|
72
|
-
const initial = "**Titolo** con testo in markdown";
|
|
74
|
+
const initial = "**Titolo** con testo in <u>markdown</u> e *corsivo*";
|
|
73
75
|
const [md, setMd] = React.useState(initial);
|
|
74
76
|
return (
|
|
75
77
|
<AppEditor
|
|
@@ -81,10 +83,31 @@ export function MarkdownDefault() {
|
|
|
81
83
|
}
|
|
82
84
|
```
|
|
83
85
|
|
|
86
|
+
### Underline Support
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import * as React from "react";
|
|
90
|
+
import { AppEditor } from "laif-ds";
|
|
91
|
+
|
|
92
|
+
export function UnderlineExample() {
|
|
93
|
+
const initial = "Testo normale <u>testo sottolineato</u> altro normale";
|
|
94
|
+
const [md, setMd] = React.useState(initial);
|
|
95
|
+
return (
|
|
96
|
+
<AppEditor
|
|
97
|
+
defaultValue={initial}
|
|
98
|
+
onMarkdownEdit={setMd}
|
|
99
|
+
toolbars={["font-format"]}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
84
105
|
---
|
|
85
106
|
|
|
86
107
|
## Notes
|
|
87
108
|
|
|
88
|
-
- **Sizing**: Control height via `className` (e.g., `h-96`).
|
|
109
|
+
- **Sizing**: Control height via `className` (e.g., `h-96`). Default height is `h-72`.
|
|
89
110
|
- **Performance**: Prefer Markdown mode for content pipelines that store Markdown; use `onlyMarkdown=false` for plain text initialization.
|
|
90
111
|
- **Accessibility**: Toolbar buttons and editor area follow Lexical best practices.
|
|
112
|
+
- **Underline Syntax**: Uses `<u>text</u>` HTML tags for underline, which is standard HTML and natively supported by both this component and `MarkdownRenderer` via `rehype-raw`.
|
|
113
|
+
- **Theme**: Uses design system tokens for consistent styling with `border-d-border`, `bg-d-background`, etc.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.1.0",
|
|
3
|
-
"generatedAt": "2026-
|
|
3
|
+
"generatedAt": "2026-04-01T11:02:03.665Z",
|
|
4
4
|
"package": {
|
|
5
5
|
"name": "laif-ds",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.79"
|
|
7
7
|
},
|
|
8
8
|
"stats": {
|
|
9
9
|
"documentedComponentCount": 92,
|
|
@@ -531,7 +531,8 @@
|
|
|
531
531
|
"hasExamples": true,
|
|
532
532
|
"exampleTitles": [
|
|
533
533
|
"Full Toolbar + Plugins",
|
|
534
|
-
"Markdown Default Value"
|
|
534
|
+
"Markdown Default Value",
|
|
535
|
+
"Underline Support"
|
|
535
536
|
],
|
|
536
537
|
"controlledPattern": "likely-controlled",
|
|
537
538
|
"requiredProps": []
|
|
@@ -6058,5 +6059,5 @@
|
|
|
6058
6059
|
]
|
|
6059
6060
|
}
|
|
6060
6061
|
],
|
|
6061
|
-
"checksum": "
|
|
6062
|
+
"checksum": "405eb253ef5b553303bd5f6005a1395f86f08f55c627c8c96046719fcf78a9ad"
|
|
6062
6063
|
}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { ContentEditable as
|
|
4
|
-
|
|
3
|
+
import { ContentEditable as r } from "../../../node_modules/@lexical/react/LexicalContentEditable.prod.js";
|
|
4
|
+
import { cn as o } from "../../../lib/utils.js";
|
|
5
|
+
function s({
|
|
5
6
|
placeholder: e,
|
|
6
|
-
className:
|
|
7
|
-
placeholderClassName:
|
|
7
|
+
className: n,
|
|
8
|
+
placeholderClassName: l
|
|
8
9
|
}) {
|
|
9
10
|
return /* @__PURE__ */ t(
|
|
10
|
-
|
|
11
|
+
r,
|
|
11
12
|
{
|
|
12
|
-
className: o
|
|
13
|
+
className: o(
|
|
14
|
+
"ContentEditable__root relative block overflow-auto px-8 py-4 focus:outline-none",
|
|
15
|
+
n
|
|
16
|
+
),
|
|
13
17
|
"aria-placeholder": e,
|
|
14
18
|
placeholder: /* @__PURE__ */ t(
|
|
15
19
|
"div",
|
|
16
20
|
{
|
|
17
|
-
className:
|
|
21
|
+
className: o(
|
|
22
|
+
"text-muted-foreground pointer-events-none absolute top-0 left-0 overflow-hidden px-8 py-[18px] text-ellipsis select-none",
|
|
23
|
+
l
|
|
24
|
+
),
|
|
18
25
|
children: e
|
|
19
26
|
}
|
|
20
27
|
)
|
|
@@ -22,5 +29,5 @@ function a({
|
|
|
22
29
|
);
|
|
23
30
|
}
|
|
24
31
|
export {
|
|
25
|
-
|
|
32
|
+
s as ContentEditable
|
|
26
33
|
};
|
|
@@ -1,150 +1,169 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as
|
|
3
|
-
import { ListNode as
|
|
4
|
-
import { $convertToMarkdownString as
|
|
2
|
+
import { jsx as r, jsxs as e, Fragment as s } from "react/jsx-runtime";
|
|
3
|
+
import { ListNode as S, ListItemNode as T } from "../../node_modules/@lexical/list/LexicalList.prod.js";
|
|
4
|
+
import { $convertToMarkdownString as L, $convertFromMarkdownString as k, TRANSFORMERS as A } from "../../node_modules/@lexical/markdown/LexicalMarkdown.prod.js";
|
|
5
5
|
import { CheckListPlugin as j } from "../../node_modules/@lexical/react/LexicalCheckListPlugin.prod.js";
|
|
6
|
-
import { ClearEditorPlugin as
|
|
7
|
-
import { LexicalComposer as
|
|
8
|
-
import { useLexicalComposerContext as
|
|
9
|
-
import { LexicalErrorBoundary as
|
|
10
|
-
import { HistoryPlugin as
|
|
11
|
-
import { ListPlugin as
|
|
12
|
-
import { OnChangePlugin as
|
|
13
|
-
import { RichTextPlugin as
|
|
14
|
-
import { HeadingNode as
|
|
15
|
-
import { ParagraphNode as d, TextNode as
|
|
16
|
-
import { useState as
|
|
17
|
-
import { ContentEditable as
|
|
18
|
-
import { ActionsPlugin as
|
|
19
|
-
import { ClearEditorActionPlugin as
|
|
20
|
-
import { CounterCharacterPlugin as
|
|
21
|
-
import { FormatBulletedList as
|
|
22
|
-
import { FormatCheckList as
|
|
23
|
-
import { FormatHeading as
|
|
24
|
-
import { FormatNumberedList as
|
|
25
|
-
import { FormatParagraph as
|
|
26
|
-
import { FormatQuote as
|
|
27
|
-
import { BlockFormatDropDown as
|
|
6
|
+
import { ClearEditorPlugin as O } from "../../node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js";
|
|
7
|
+
import { LexicalComposer as $ } from "../../node_modules/@lexical/react/LexicalComposer.prod.js";
|
|
8
|
+
import { useLexicalComposerContext as B } from "../../node_modules/@lexical/react/LexicalComposerContext.prod.js";
|
|
9
|
+
import { LexicalErrorBoundary as D } from "../../node_modules/@lexical/react/LexicalErrorBoundary.prod.js";
|
|
10
|
+
import { HistoryPlugin as H } from "../../node_modules/@lexical/react/LexicalHistoryPlugin.prod.js";
|
|
11
|
+
import { ListPlugin as I } from "../../node_modules/@lexical/react/LexicalListPlugin.prod.js";
|
|
12
|
+
import { OnChangePlugin as M } from "../../node_modules/@lexical/react/LexicalOnChangePlugin.prod.js";
|
|
13
|
+
import { RichTextPlugin as U } from "../../node_modules/@lexical/react/LexicalRichTextPlugin.prod.js";
|
|
14
|
+
import { HeadingNode as z, QuoteNode as Q } from "../../node_modules/@lexical/rich-text/LexicalRichText.prod.js";
|
|
15
|
+
import { ParagraphNode as d, TextNode as f, $getRoot as p } from "../../node_modules/lexical/Lexical.prod.js";
|
|
16
|
+
import { useState as _, useEffect as J } from "react";
|
|
17
|
+
import { ContentEditable as q } from "../editor/editor-ui/content-editable.js";
|
|
18
|
+
import { ActionsPlugin as G } from "../editor/plugins/actions/actions-plugin.js";
|
|
19
|
+
import { ClearEditorActionPlugin as K } from "../editor/plugins/actions/clear-editor-plugin.js";
|
|
20
|
+
import { CounterCharacterPlugin as W } from "../editor/plugins/actions/counter-character-plugin.js";
|
|
21
|
+
import { FormatBulletedList as X } from "../editor/plugins/toolbar/block-format/format-bulleted-list.js";
|
|
22
|
+
import { FormatCheckList as Y } from "../editor/plugins/toolbar/block-format/format-check-list.js";
|
|
23
|
+
import { FormatHeading as Z } from "../editor/plugins/toolbar/block-format/format-heading.js";
|
|
24
|
+
import { FormatNumberedList as V } from "../editor/plugins/toolbar/block-format/format-numbered-list.js";
|
|
25
|
+
import { FormatParagraph as rr } from "../editor/plugins/toolbar/block-format/format-paragraph.js";
|
|
26
|
+
import { FormatQuote as or } from "../editor/plugins/toolbar/block-format/format-quote.js";
|
|
27
|
+
import { BlockFormatDropDown as er } from "../editor/plugins/toolbar/block-format-toolbar-plugin.js";
|
|
28
28
|
import { FontFormatToolbarPlugin as l } from "../editor/plugins/toolbar/font-format-toolbar-plugin.js";
|
|
29
29
|
import { ToolbarPlugin as c } from "../editor/plugins/toolbar/toolbar-plugin.js";
|
|
30
|
-
import { editorTheme as
|
|
31
|
-
import { TooltipProvider as
|
|
32
|
-
import { HistoryToolbarPlugin as
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
import { editorTheme as tr } from "../editor/themes/editor-theme.js";
|
|
31
|
+
import { TooltipProvider as ir } from "./tooltip.js";
|
|
32
|
+
import { HistoryToolbarPlugin as nr } from "../editor/plugins/toolbar/history-toolbar-plugin.js";
|
|
33
|
+
import { cn as ar } from "../../lib/utils.js";
|
|
34
|
+
const lr = "Start typing...", mr = {
|
|
35
|
+
format: ["underline"],
|
|
36
|
+
tag: "++",
|
|
37
|
+
type: "text-format"
|
|
38
|
+
}, v = [
|
|
39
|
+
...A,
|
|
40
|
+
mr
|
|
41
|
+
], sr = (o) => o.replace(/<u>(.*?)<\/u>/g, "++$1++"), cr = (o) => o.replace(/\+\+(.+?)\+\+/g, "<u>$1</u>");
|
|
42
|
+
function dr({
|
|
35
43
|
defaultValue: o,
|
|
36
44
|
onlyMarkdown: i
|
|
37
45
|
}) {
|
|
38
|
-
const [n] =
|
|
39
|
-
return
|
|
46
|
+
const [n] = B();
|
|
47
|
+
return J(() => {
|
|
40
48
|
o && n.update(() => {
|
|
41
|
-
i ?
|
|
42
|
-
|
|
49
|
+
i ? k(
|
|
50
|
+
sr(o),
|
|
51
|
+
v
|
|
52
|
+
) : p().append(
|
|
53
|
+
new d().append(new f(o))
|
|
43
54
|
);
|
|
44
|
-
const a =
|
|
55
|
+
const a = p();
|
|
45
56
|
(a.getFirstChild() ?? a).selectStart();
|
|
46
57
|
});
|
|
47
58
|
}, [n, o, i]), null;
|
|
48
59
|
}
|
|
49
|
-
function
|
|
60
|
+
function _r({
|
|
50
61
|
defaultValue: o,
|
|
51
62
|
onMarkdownEdit: i,
|
|
52
63
|
plugins: n = [],
|
|
53
64
|
toolbars: a = [],
|
|
54
|
-
placeholder:
|
|
65
|
+
placeholder: F = lr,
|
|
55
66
|
onlyMarkdown: h = !0,
|
|
56
|
-
className:
|
|
67
|
+
className: C = "rounded-lg border border-d-border",
|
|
68
|
+
wrpClassName: E = ""
|
|
57
69
|
}) {
|
|
58
|
-
const [, P] =
|
|
70
|
+
const [, P] = _(null), w = {
|
|
59
71
|
namespace: "AppEditor",
|
|
60
|
-
theme:
|
|
72
|
+
theme: tr,
|
|
61
73
|
nodes: [
|
|
62
|
-
|
|
74
|
+
z,
|
|
63
75
|
d,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
f,
|
|
77
|
+
Q,
|
|
78
|
+
S,
|
|
79
|
+
T
|
|
68
80
|
],
|
|
69
|
-
onError: (
|
|
70
|
-
console.error(
|
|
81
|
+
onError: (t) => {
|
|
82
|
+
console.error(t);
|
|
71
83
|
},
|
|
72
84
|
...o && !h ? {
|
|
73
85
|
editorState: () => {
|
|
74
|
-
|
|
75
|
-
new d().append(new
|
|
86
|
+
p().append(
|
|
87
|
+
new d().append(new f(o))
|
|
76
88
|
);
|
|
77
89
|
}
|
|
78
90
|
} : {}
|
|
79
|
-
}, u = (
|
|
80
|
-
return /* @__PURE__ */ r("div", { className: "bg-d-background", children: /* @__PURE__ */ r(
|
|
91
|
+
}, u = (t) => n.includes(t), m = (t) => a.includes(t), g = u("clear"), x = u("counter"), b = m("block-format"), y = m("font-format"), N = m("history");
|
|
92
|
+
return /* @__PURE__ */ r("div", { className: ar("bg-d-background flex h-96 flex-col", E), children: /* @__PURE__ */ r($, { initialConfig: w, children: /* @__PURE__ */ e(ir, { children: [
|
|
81
93
|
o && /* @__PURE__ */ r(
|
|
82
|
-
|
|
94
|
+
dr,
|
|
83
95
|
{
|
|
84
96
|
defaultValue: o,
|
|
85
97
|
onlyMarkdown: h
|
|
86
98
|
}
|
|
87
99
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
b && /* @__PURE__ */ r(c, { children: () => /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */ r(
|
|
92
|
-
/* @__PURE__ */ r(
|
|
100
|
+
/* @__PURE__ */ e("div", { className: "border-d-border flex items-center border-b", children: [
|
|
101
|
+
N && /* @__PURE__ */ r(c, { children: () => /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ r(nr, {}) }) }),
|
|
102
|
+
b && /* @__PURE__ */ r(c, { children: () => /* @__PURE__ */ r(s, { children: /* @__PURE__ */ r("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: /* @__PURE__ */ e(er, { children: [
|
|
103
|
+
/* @__PURE__ */ r(rr, {}),
|
|
104
|
+
/* @__PURE__ */ r(Z, { levels: ["h1", "h2", "h3"] }),
|
|
105
|
+
/* @__PURE__ */ r(V, {}),
|
|
106
|
+
/* @__PURE__ */ r(X, {}),
|
|
93
107
|
/* @__PURE__ */ r(Y, {}),
|
|
94
|
-
/* @__PURE__ */ r(
|
|
95
|
-
/* @__PURE__ */ r(W, {}),
|
|
96
|
-
/* @__PURE__ */ r(V, {})
|
|
108
|
+
/* @__PURE__ */ r(or, {})
|
|
97
109
|
] }) }) }) }),
|
|
98
|
-
|
|
110
|
+
y && /* @__PURE__ */ r(c, { children: () => /* @__PURE__ */ e("div", { className: "vertical-align-middle sticky top-0 z-10 flex gap-2 overflow-auto p-1", children: [
|
|
99
111
|
/* @__PURE__ */ r(l, { format: "bold" }),
|
|
100
112
|
/* @__PURE__ */ r(l, { format: "italic" }),
|
|
101
113
|
/* @__PURE__ */ r(l, { format: "underline" }),
|
|
102
114
|
/* @__PURE__ */ r(l, { format: "strikethrough" })
|
|
103
115
|
] }) })
|
|
104
116
|
] }),
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
117
|
+
/* @__PURE__ */ e("div", { className: "relative flex min-h-0 w-full flex-1 flex-col", children: [
|
|
118
|
+
N && /* @__PURE__ */ r(H, {}),
|
|
107
119
|
/* @__PURE__ */ r(
|
|
108
|
-
|
|
120
|
+
U,
|
|
109
121
|
{
|
|
110
|
-
ErrorBoundary:
|
|
111
|
-
contentEditable: /* @__PURE__ */ r(
|
|
112
|
-
|
|
122
|
+
ErrorBoundary: D,
|
|
123
|
+
contentEditable: /* @__PURE__ */ r(
|
|
124
|
+
"div",
|
|
113
125
|
{
|
|
114
|
-
|
|
115
|
-
className:
|
|
126
|
+
ref: P,
|
|
127
|
+
className: "flex min-h-0 w-full flex-1 overflow-auto",
|
|
128
|
+
children: /* @__PURE__ */ r(
|
|
129
|
+
q,
|
|
130
|
+
{
|
|
131
|
+
placeholder: F,
|
|
132
|
+
className: `border-d-border w-full rounded-none border-b ${C}`
|
|
133
|
+
}
|
|
134
|
+
)
|
|
116
135
|
}
|
|
117
|
-
)
|
|
136
|
+
)
|
|
118
137
|
}
|
|
119
138
|
),
|
|
120
|
-
b && /* @__PURE__ */
|
|
121
|
-
/* @__PURE__ */ r(
|
|
139
|
+
b && /* @__PURE__ */ e(s, { children: [
|
|
140
|
+
/* @__PURE__ */ r(I, {}),
|
|
122
141
|
/* @__PURE__ */ r(j, {})
|
|
123
142
|
] }),
|
|
124
|
-
(g ||
|
|
143
|
+
(g || x) && /* @__PURE__ */ r(G, { children: /* @__PURE__ */ e("div", { className: "clear-both flex items-center justify-between gap-2 p-1", children: [
|
|
125
144
|
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-start" }),
|
|
126
|
-
/* @__PURE__ */ r("div", { children:
|
|
127
|
-
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-end gap-2", children: g && /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */ r(
|
|
129
|
-
/* @__PURE__ */ r(
|
|
145
|
+
/* @__PURE__ */ r("div", { children: x && /* @__PURE__ */ r(W, { charset: "UTF-16" }) }),
|
|
146
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 justify-end gap-2", children: g && /* @__PURE__ */ e(s, { children: [
|
|
147
|
+
/* @__PURE__ */ r(K, {}),
|
|
148
|
+
/* @__PURE__ */ r(O, {})
|
|
130
149
|
] }) })
|
|
131
150
|
] }) })
|
|
132
151
|
] }),
|
|
133
152
|
/* @__PURE__ */ r(
|
|
134
|
-
|
|
153
|
+
M,
|
|
135
154
|
{
|
|
136
155
|
ignoreSelectionChange: !0,
|
|
137
|
-
onChange: (
|
|
156
|
+
onChange: (t) => {
|
|
138
157
|
if (!i) return;
|
|
139
|
-
const
|
|
140
|
-
() =>
|
|
158
|
+
const R = t.read(
|
|
159
|
+
() => L(v)
|
|
141
160
|
);
|
|
142
|
-
i(
|
|
161
|
+
i(cr(R));
|
|
143
162
|
}
|
|
144
163
|
}
|
|
145
164
|
)
|
|
146
165
|
] }) }) });
|
|
147
166
|
}
|
|
148
167
|
export {
|
|
149
|
-
|
|
168
|
+
_r as AppEditor
|
|
150
169
|
};
|
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as t, jsxs as p, Fragment as y } from "react/jsx-runtime";
|
|
3
3
|
import g, { Suspense as x } from "react";
|
|
4
4
|
import { CopyButton as k } from "./copy-button.js";
|
|
5
5
|
import { cn as m } from "../../lib/utils.js";
|
|
6
|
-
import { Markdown as
|
|
6
|
+
import { Markdown as w } from "../../node_modules/react-markdown/lib/index.js";
|
|
7
|
+
import N from "../../node_modules/rehype-raw/lib/index.js";
|
|
7
8
|
import v from "../../node_modules/remark-gfm/lib/index.js";
|
|
8
|
-
function
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
function B({ children: e }) {
|
|
10
|
+
return /* @__PURE__ */ t("div", { className: "space-y-3", children: /* @__PURE__ */ t(
|
|
11
|
+
w,
|
|
12
|
+
{
|
|
13
|
+
remarkPlugins: [v],
|
|
14
|
+
rehypePlugins: [N],
|
|
15
|
+
components: S,
|
|
16
|
+
children: e
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
10
19
|
}
|
|
11
|
-
const
|
|
12
|
-
async ({ children: e, language:
|
|
20
|
+
const u = g.memo(
|
|
21
|
+
async ({ children: e, language: o, ...n }) => {
|
|
13
22
|
const { codeToTokens: i, bundledLanguages: d } = await import("../../node_modules/shiki/dist/index.js");
|
|
14
|
-
if (!(
|
|
15
|
-
return /* @__PURE__ */
|
|
23
|
+
if (!(o in d))
|
|
24
|
+
return /* @__PURE__ */ t("pre", { ...n, children: e });
|
|
16
25
|
const { tokens: l } = await i(e, {
|
|
17
|
-
lang:
|
|
26
|
+
lang: o,
|
|
18
27
|
defaultColor: !1,
|
|
19
28
|
themes: {
|
|
20
29
|
light: "github-light",
|
|
21
30
|
dark: "github-dark"
|
|
22
31
|
}
|
|
23
32
|
});
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ t("pre", { ...n, children: /* @__PURE__ */ t("code", { children: l.map((h, c) => /* @__PURE__ */ p(y, { children: [
|
|
34
|
+
/* @__PURE__ */ t("span", { children: h.map((a, b) => {
|
|
26
35
|
const f = typeof a.htmlStyle == "string" ? void 0 : a.htmlStyle;
|
|
27
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ t(
|
|
28
37
|
"span",
|
|
29
38
|
{
|
|
30
39
|
className: "text-shiki-light bg-shiki-light-bg dark:text-shiki-dark dark:bg-shiki-dark-bg",
|
|
@@ -39,53 +48,54 @@ const h = g.memo(
|
|
|
39
48
|
] })) }) });
|
|
40
49
|
}
|
|
41
50
|
);
|
|
42
|
-
|
|
43
|
-
const
|
|
51
|
+
u.displayName = "HighlightedCode";
|
|
52
|
+
const C = ({
|
|
44
53
|
children: e,
|
|
45
|
-
className:
|
|
54
|
+
className: o,
|
|
46
55
|
language: n,
|
|
47
56
|
...i
|
|
48
57
|
}) => {
|
|
49
58
|
const d = typeof e == "string" ? e : s(e), l = m(
|
|
50
59
|
"overflow-x-scroll rounded-md border border-d-border bg-d-background/50 p-4 font-mono text-sm [scrollbar-width:none]",
|
|
51
|
-
|
|
60
|
+
o
|
|
52
61
|
);
|
|
53
62
|
return /* @__PURE__ */ p("div", { className: "group/code relative mb-4", children: [
|
|
54
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ t(
|
|
55
64
|
x,
|
|
56
65
|
{
|
|
57
|
-
fallback: /* @__PURE__ */
|
|
58
|
-
children: /* @__PURE__ */
|
|
66
|
+
fallback: /* @__PURE__ */ t("pre", { className: l, ...i, children: e }),
|
|
67
|
+
children: /* @__PURE__ */ t(u, { language: n, className: l, children: d })
|
|
59
68
|
}
|
|
60
69
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ t("div", { className: "invisible absolute top-2 right-2 flex space-x-1 rounded-lg p-1 opacity-0 transition-all duration-200 group-hover/code:visible group-hover/code:opacity-100", children: /* @__PURE__ */ t(k, { content: d, copyMessage: "Copied code to clipboard" }) })
|
|
62
71
|
] });
|
|
63
72
|
};
|
|
64
73
|
function s(e) {
|
|
65
74
|
if (typeof e == "string")
|
|
66
75
|
return e;
|
|
67
76
|
if (g.isValidElement(e) && e.props && typeof e.props == "object" && "children" in e.props) {
|
|
68
|
-
const
|
|
69
|
-
return
|
|
77
|
+
const o = e.props.children;
|
|
78
|
+
return o && typeof o == "object" && Array.isArray(o) ? o.map((n) => s(n)).join("") : s(o);
|
|
70
79
|
}
|
|
71
80
|
return "";
|
|
72
81
|
}
|
|
73
|
-
const
|
|
82
|
+
const S = {
|
|
74
83
|
h1: r("h1", "text-2xl font-semibold"),
|
|
75
84
|
h2: r("h2", "font-semibold text-xl"),
|
|
76
85
|
h3: r("h3", "font-semibold text-lg"),
|
|
77
86
|
h4: r("h4", "font-semibold text-base"),
|
|
78
87
|
h5: r("h5", "font-medium"),
|
|
79
88
|
strong: r("strong", "font-semibold"),
|
|
89
|
+
u: r("u", "underline"),
|
|
80
90
|
a: r("a", "text-d-primary underline underline-offset-2"),
|
|
81
91
|
blockquote: r("blockquote", "border-l-2 border-d-primary pl-4"),
|
|
82
92
|
code: ({
|
|
83
93
|
children: e,
|
|
84
|
-
className:
|
|
94
|
+
className: o,
|
|
85
95
|
...n
|
|
86
96
|
}) => {
|
|
87
|
-
const i = /language-(\w+)/.exec(
|
|
88
|
-
return i ? /* @__PURE__ */
|
|
97
|
+
const i = /language-(\w+)/.exec(o || "");
|
|
98
|
+
return i ? /* @__PURE__ */ t(C, { className: o, language: i[1], ...n, children: e }) : /* @__PURE__ */ t(
|
|
89
99
|
"code",
|
|
90
100
|
{
|
|
91
101
|
className: m(
|
|
@@ -116,13 +126,13 @@ const C = {
|
|
|
116
126
|
p: r("p", "whitespace-pre-wrap"),
|
|
117
127
|
hr: r("hr", "border-foreground/20")
|
|
118
128
|
};
|
|
119
|
-
function r(e,
|
|
129
|
+
function r(e, o) {
|
|
120
130
|
const n = ({
|
|
121
131
|
...i
|
|
122
|
-
}) => /* @__PURE__ */
|
|
132
|
+
}) => /* @__PURE__ */ t(e, { className: o, ...i });
|
|
123
133
|
return n.displayName = String(e), n;
|
|
124
134
|
}
|
|
125
135
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
136
|
+
B as MarkdownRenderer,
|
|
137
|
+
B as default
|
|
128
138
|
};
|