@reacteditor/core 0.0.1-alpha.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/README.md +85 -0
- package/dist/Editor-GBV2O5RD.css +415 -0
- package/dist/Editor-IKMJILGR.mjs +204 -0
- package/dist/Render-EFT7YD2C.css +103 -0
- package/dist/Render-VDC7AEQK.mjs +55 -0
- package/dist/actions-BCDhqbeL.d.mts +849 -0
- package/dist/actions-BCDhqbeL.d.ts +849 -0
- package/dist/chunk-2YLS65V2.mjs +103 -0
- package/dist/chunk-6B2Q5R3C.mjs +53 -0
- package/dist/chunk-DXGQXXQG.mjs +63 -0
- package/dist/chunk-F7S5S6I2.mjs +114 -0
- package/dist/chunk-GAUBBDIR.mjs +463 -0
- package/dist/chunk-GUMYXUO3.mjs +33 -0
- package/dist/chunk-M6W7YEVX.mjs +95 -0
- package/dist/chunk-MFI3RDA4.mjs +11 -0
- package/dist/chunk-QNHSXCWU.mjs +8692 -0
- package/dist/chunk-SURZYH7D.mjs +1726 -0
- package/dist/chunk-V2OPYD42.mjs +708 -0
- package/dist/chunk-VD3EVRUF.mjs +476 -0
- package/dist/chunk-VOLQMQPK.mjs +146 -0
- package/dist/chunk-VUEM62JF.mjs +523 -0
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/full-ELX6RALJ.css +311 -0
- package/dist/full-OBTPW7TC.mjs +93 -0
- package/dist/index-ComBHfdn.d.ts +117 -0
- package/dist/index-DVwiIwYU.d.mts +117 -0
- package/dist/index.css +3033 -0
- package/dist/index.d.mts +396 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.js +14688 -0
- package/dist/index.mjs +87 -0
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +931 -0
- package/dist/internal.mjs +13 -0
- package/dist/loaded-35WC23HJ.mjs +60 -0
- package/dist/loaded-TBSVRJPY.css +90 -0
- package/dist/loaded-ULSROV73.mjs +57 -0
- package/dist/loaded-YYRJPIWZ.mjs +57 -0
- package/dist/no-external.css +3031 -0
- package/dist/no-external.d.mts +21 -0
- package/dist/no-external.d.ts +21 -0
- package/dist/no-external.js +14688 -0
- package/dist/no-external.mjs +87 -0
- package/dist/rsc.css +103 -0
- package/dist/rsc.d.mts +27 -0
- package/dist/rsc.d.ts +27 -0
- package/dist/rsc.js +1493 -0
- package/dist/rsc.mjs +148 -0
- package/dist/walk-tree-BPIigVTF.d.mts +29 -0
- package/dist/walk-tree-BZq1CPCH.d.ts +29 -0
- package/package.json +139 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useHeadingOptions
|
|
3
|
+
} from "./chunk-DXGQXXQG.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Heading,
|
|
6
|
+
SelectControl,
|
|
7
|
+
useControlContext
|
|
8
|
+
} from "./chunk-SURZYH7D.mjs";
|
|
9
|
+
import "./chunk-VUEM62JF.mjs";
|
|
10
|
+
import "./chunk-VOLQMQPK.mjs";
|
|
11
|
+
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
+
import "./chunk-GAUBBDIR.mjs";
|
|
13
|
+
import {
|
|
14
|
+
init_react_import
|
|
15
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
16
|
+
|
|
17
|
+
// components/RichTextMenu/controls/HeadingSelect/loaded.tsx
|
|
18
|
+
init_react_import();
|
|
19
|
+
import { useEditorState } from "@tiptap/react";
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
function HeadingSelectLoaded() {
|
|
22
|
+
const { options } = useControlContext();
|
|
23
|
+
const headingOptions = useHeadingOptions(options);
|
|
24
|
+
const { editor } = useControlContext();
|
|
25
|
+
const currentValue = useEditorState({
|
|
26
|
+
editor,
|
|
27
|
+
selector: (ctx) => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if ((_a = ctx.editor) == null ? void 0 : _a.isActive("paragraph")) return "p";
|
|
30
|
+
for (let level = 1; level <= 6; level++) {
|
|
31
|
+
if ((_b = ctx.editor) == null ? void 0 : _b.isActive("heading", { level })) {
|
|
32
|
+
return `h${level}`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return "p";
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const handleChange = (val) => {
|
|
39
|
+
const chain = editor == null ? void 0 : editor.chain();
|
|
40
|
+
if (val === "p") {
|
|
41
|
+
chain == null ? void 0 : chain.focus().setParagraph().run();
|
|
42
|
+
} else {
|
|
43
|
+
const level = parseInt(val.replace("h", ""), 10);
|
|
44
|
+
chain == null ? void 0 : chain.focus().toggleHeading({ level }).run();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
SelectControl,
|
|
49
|
+
{
|
|
50
|
+
options: headingOptions,
|
|
51
|
+
onChange: handleChange,
|
|
52
|
+
value: currentValue != null ? currentValue : "p",
|
|
53
|
+
defaultValue: "p",
|
|
54
|
+
renderDefaultIcon: Heading
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
HeadingSelectLoaded
|
|
60
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* css-module:/Users/rami/Documents/apps/frontend-react-editor/packages/core/components/Select/styles.module.css/#css-module-data */
|
|
2
|
+
._Select_6nen1_1 {
|
|
3
|
+
position: relative;
|
|
4
|
+
z-index: 1;
|
|
5
|
+
}
|
|
6
|
+
._Select-button_6nen1_6 {
|
|
7
|
+
align-items: center;
|
|
8
|
+
background: transparent;
|
|
9
|
+
border: none;
|
|
10
|
+
border-radius: var(--re-radius-sm);
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
gap: 0px;
|
|
14
|
+
height: 100%;
|
|
15
|
+
padding: 4px;
|
|
16
|
+
padding-right: 2px;
|
|
17
|
+
transition: background-color var(--re-motion-fast) var(--re-ease), color var(--re-motion-fast) var(--re-ease);
|
|
18
|
+
}
|
|
19
|
+
._Select--hasOptions_6nen1_21 ._Select-button_6nen1_6 {
|
|
20
|
+
color: currentColor;
|
|
21
|
+
}
|
|
22
|
+
._Select--hasOptions_6nen1_21:not(._Select--disabled_6nen1_25) ._Select-button_6nen1_6 {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
._Select-buttonIcon_6nen1_29 {
|
|
26
|
+
align-items: center;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
}
|
|
30
|
+
._Select--standalone_6nen1_35 ._Select-buttonIcon_6nen1_29 .lucide {
|
|
31
|
+
height: 18px;
|
|
32
|
+
width: 18px;
|
|
33
|
+
}
|
|
34
|
+
._Select--actionBar_6nen1_40 ._Select-buttonIcon_6nen1_29 .lucide {
|
|
35
|
+
height: 16px;
|
|
36
|
+
width: 16px;
|
|
37
|
+
}
|
|
38
|
+
._Select--hasOptions_6nen1_21:not(._Select--disabled_6nen1_25) ._Select-button_6nen1_6:hover,
|
|
39
|
+
._Select--hasValue_6nen1_46 ._Select-button_6nen1_6 {
|
|
40
|
+
background: var(--re-surface-hover);
|
|
41
|
+
color: var(--re-text-accent);
|
|
42
|
+
}
|
|
43
|
+
._Select--disabled_6nen1_25 ._Select-button_6nen1_6 {
|
|
44
|
+
color: var(--re-text-tertiary);
|
|
45
|
+
}
|
|
46
|
+
._Select--actionBar_6nen1_40 {
|
|
47
|
+
&._Select--hasOptions_6nen1_21 ._Select-button_6nen1_6:hover,
|
|
48
|
+
&._Select--hasValue_6nen1_46 ._Select-button_6nen1_6 {
|
|
49
|
+
background: rgba(255, 255, 255, 0.12);
|
|
50
|
+
color: var(--re-text-inverse);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
._Select-items_6nen1_63 {
|
|
54
|
+
background: var(--re-surface-panel);
|
|
55
|
+
border: 1px solid var(--re-border-subtle);
|
|
56
|
+
border-radius: var(--re-radius-lg);
|
|
57
|
+
box-shadow: var(--re-shadow-lg);
|
|
58
|
+
margin: 10px 8px;
|
|
59
|
+
margin-left: 0;
|
|
60
|
+
padding: 4px;
|
|
61
|
+
z-index: 2;
|
|
62
|
+
list-style: none;
|
|
63
|
+
}
|
|
64
|
+
._SelectItem_6nen1_75 {
|
|
65
|
+
background: transparent;
|
|
66
|
+
border-radius: var(--re-radius-sm);
|
|
67
|
+
border: none;
|
|
68
|
+
color: var(--re-text-secondary);
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: 8px;
|
|
72
|
+
align-items: center;
|
|
73
|
+
font-size: var(--re-font-size-xxs);
|
|
74
|
+
margin: 0;
|
|
75
|
+
padding: 8px 12px;
|
|
76
|
+
width: 100%;
|
|
77
|
+
transition: background-color var(--re-motion-fast) var(--re-ease), color var(--re-motion-fast) var(--re-ease);
|
|
78
|
+
}
|
|
79
|
+
._SelectItem--isSelected_6nen1_92 {
|
|
80
|
+
background: var(--re-accent-soft);
|
|
81
|
+
color: var(--re-text-accent);
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
}
|
|
84
|
+
._SelectItem--isSelected_6nen1_92 ._SelectItem-icon_6nen1_98 {
|
|
85
|
+
color: var(--re-text-accent);
|
|
86
|
+
}
|
|
87
|
+
._SelectItem_6nen1_75:hover {
|
|
88
|
+
background: var(--re-surface-hover);
|
|
89
|
+
color: var(--re-text-accent);
|
|
90
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useAlignOptions
|
|
3
|
+
} from "./chunk-6B2Q5R3C.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AlignLeft,
|
|
6
|
+
SelectControl,
|
|
7
|
+
useControlContext
|
|
8
|
+
} from "./chunk-SURZYH7D.mjs";
|
|
9
|
+
import "./chunk-VUEM62JF.mjs";
|
|
10
|
+
import "./chunk-VOLQMQPK.mjs";
|
|
11
|
+
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
+
import "./chunk-GAUBBDIR.mjs";
|
|
13
|
+
import {
|
|
14
|
+
init_react_import
|
|
15
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
16
|
+
|
|
17
|
+
// components/RichTextMenu/controls/AlignSelect/loaded.tsx
|
|
18
|
+
init_react_import();
|
|
19
|
+
import { useEditorState } from "@tiptap/react";
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
function AlignSelectLoaded() {
|
|
22
|
+
var _a;
|
|
23
|
+
const { options } = useControlContext();
|
|
24
|
+
const alignOptions = useAlignOptions(options);
|
|
25
|
+
const { editor } = useControlContext();
|
|
26
|
+
const currentValue = (_a = useEditorState({
|
|
27
|
+
editor,
|
|
28
|
+
selector: (ctx) => {
|
|
29
|
+
var _a2, _b, _c, _d;
|
|
30
|
+
if ((_a2 = ctx.editor) == null ? void 0 : _a2.isActive({ textAlign: "center" })) {
|
|
31
|
+
return "center";
|
|
32
|
+
} else if ((_b = ctx.editor) == null ? void 0 : _b.isActive({ textAlign: "right" })) {
|
|
33
|
+
return "right";
|
|
34
|
+
} else if ((_c = ctx.editor) == null ? void 0 : _c.isActive({ textAlign: "justify" })) {
|
|
35
|
+
return "justify";
|
|
36
|
+
}
|
|
37
|
+
return (options == null ? void 0 : options.textAlign) ? (_d = options.textAlign.defaultAlignment) != null ? _d : "left" : "left";
|
|
38
|
+
}
|
|
39
|
+
})) != null ? _a : "left";
|
|
40
|
+
const handleChange = (val) => {
|
|
41
|
+
const chain = editor == null ? void 0 : editor.chain();
|
|
42
|
+
chain == null ? void 0 : chain.focus().setTextAlign(val).run();
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
SelectControl,
|
|
46
|
+
{
|
|
47
|
+
options: alignOptions,
|
|
48
|
+
onChange: handleChange,
|
|
49
|
+
value: currentValue,
|
|
50
|
+
defaultValue: "left",
|
|
51
|
+
renderDefaultIcon: AlignLeft
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
AlignSelectLoaded
|
|
57
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useListOptions
|
|
3
|
+
} from "./chunk-GUMYXUO3.mjs";
|
|
4
|
+
import {
|
|
5
|
+
List,
|
|
6
|
+
SelectControl,
|
|
7
|
+
useControlContext
|
|
8
|
+
} from "./chunk-SURZYH7D.mjs";
|
|
9
|
+
import "./chunk-VUEM62JF.mjs";
|
|
10
|
+
import "./chunk-VOLQMQPK.mjs";
|
|
11
|
+
import "./chunk-Y2EFNT5P.mjs";
|
|
12
|
+
import "./chunk-GAUBBDIR.mjs";
|
|
13
|
+
import {
|
|
14
|
+
init_react_import
|
|
15
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
16
|
+
|
|
17
|
+
// components/RichTextMenu/controls/ListSelect/loaded.tsx
|
|
18
|
+
init_react_import();
|
|
19
|
+
import { useEditorState } from "@tiptap/react";
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
function ListSelectLoaded() {
|
|
22
|
+
const { options } = useControlContext();
|
|
23
|
+
const listOptions = useListOptions(options);
|
|
24
|
+
const { editor } = useControlContext();
|
|
25
|
+
const currentValue = useEditorState({
|
|
26
|
+
editor,
|
|
27
|
+
selector: (ctx) => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if ((_a = ctx.editor) == null ? void 0 : _a.isActive("bulletList")) return "ul";
|
|
30
|
+
if ((_b = ctx.editor) == null ? void 0 : _b.isActive("orderedList")) return "ol";
|
|
31
|
+
return "p";
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const handleChange = (val) => {
|
|
35
|
+
const chain = editor == null ? void 0 : editor.chain();
|
|
36
|
+
if (val === "p") {
|
|
37
|
+
chain == null ? void 0 : chain.focus().setParagraph().run();
|
|
38
|
+
} else if (val === "ol") {
|
|
39
|
+
chain == null ? void 0 : chain.focus().toggleOrderedList().run();
|
|
40
|
+
} else if (val === "ul") {
|
|
41
|
+
chain == null ? void 0 : chain.focus().toggleBulletList().run();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
SelectControl,
|
|
46
|
+
{
|
|
47
|
+
options: listOptions,
|
|
48
|
+
onChange: handleChange,
|
|
49
|
+
value: currentValue != null ? currentValue : "p",
|
|
50
|
+
defaultValue: "p",
|
|
51
|
+
renderDefaultIcon: List
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
ListSelectLoaded
|
|
57
|
+
};
|