@plexui/vue 0.17.0 → 0.19.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.
@@ -1,8 +1,10 @@
1
1
  import { type PropType } from "vue";
2
2
  import type { Variants } from "@plexui/styles/types";
3
+ import { type MarkdownEditorFormat } from "../../lib/markdownEditorSchema.js";
3
4
  export declare const markdownEditorStyles: {
4
5
  toolbarButton: string;
5
6
  };
7
+ export type { MarkdownEditorFormat };
6
8
  declare const MarkdownEditorComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
9
  /** Visual style of the editor. @default "outline" */
8
10
  variant: {
@@ -31,6 +33,23 @@ declare const MarkdownEditorComponent: import("vue").DefineComponent<import("vue
31
33
  type: StringConstructor;
32
34
  default: undefined;
33
35
  };
36
+ /**
37
+ * The formats the editor offers, read when the editor is created. A format left out has no toolbar button,
38
+ * shortcut or input rule; pasted and incoming content keeps its text without it, and the markdown does not write it.
39
+ * @default ["bold", "italic", "orderedList", "bulletList", "link"]
40
+ */
41
+ formats: {
42
+ type: PropType<MarkdownEditorFormat[]>;
43
+ default: undefined;
44
+ };
45
+ /**
46
+ * A single newline is a line break, read and written as one "\n", read when the editor is created. Without it a
47
+ * line break is written as a backslash and a newline, and a single newline joins the lines. @default false
48
+ */
49
+ breaks: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
34
53
  /** Minimum visible rows. @default 1 */
35
54
  rows: {
36
55
  type: NumberConstructor;
@@ -84,6 +103,23 @@ declare const MarkdownEditorComponent: import("vue").DefineComponent<import("vue
84
103
  type: StringConstructor;
85
104
  default: undefined;
86
105
  };
106
+ /**
107
+ * The formats the editor offers, read when the editor is created. A format left out has no toolbar button,
108
+ * shortcut or input rule; pasted and incoming content keeps its text without it, and the markdown does not write it.
109
+ * @default ["bold", "italic", "orderedList", "bulletList", "link"]
110
+ */
111
+ formats: {
112
+ type: PropType<MarkdownEditorFormat[]>;
113
+ default: undefined;
114
+ };
115
+ /**
116
+ * A single newline is a line break, read and written as one "\n", read when the editor is created. Without it a
117
+ * line break is written as a backslash and a newline, and a single newline joins the lines. @default false
118
+ */
119
+ breaks: {
120
+ type: BooleanConstructor;
121
+ default: boolean;
122
+ };
87
123
  /** Minimum visible rows. @default 1 */
88
124
  rows: {
89
125
  type: NumberConstructor;
@@ -113,6 +149,8 @@ declare const MarkdownEditorComponent: import("vue").DefineComponent<import("vue
113
149
  variant: "soft" | "outline";
114
150
  ariaInvalid: boolean;
115
151
  rows: number;
152
+ formats: MarkdownEditorFormat[];
153
+ breaks: boolean;
116
154
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
117
155
  /**
118
156
  * Compact rich text editor for markdown, with a formatting toolbar (bold,
@@ -146,6 +184,23 @@ export declare const MarkdownEditor: import("vue").DefineComponent<import("vue")
146
184
  type: StringConstructor;
147
185
  default: undefined;
148
186
  };
187
+ /**
188
+ * The formats the editor offers, read when the editor is created. A format left out has no toolbar button,
189
+ * shortcut or input rule; pasted and incoming content keeps its text without it, and the markdown does not write it.
190
+ * @default ["bold", "italic", "orderedList", "bulletList", "link"]
191
+ */
192
+ formats: {
193
+ type: PropType<MarkdownEditorFormat[]>;
194
+ default: undefined;
195
+ };
196
+ /**
197
+ * A single newline is a line break, read and written as one "\n", read when the editor is created. Without it a
198
+ * line break is written as a backslash and a newline, and a single newline joins the lines. @default false
199
+ */
200
+ breaks: {
201
+ type: BooleanConstructor;
202
+ default: boolean;
203
+ };
149
204
  /** Minimum visible rows. @default 1 */
150
205
  rows: {
151
206
  type: NumberConstructor;
@@ -199,6 +254,23 @@ export declare const MarkdownEditor: import("vue").DefineComponent<import("vue")
199
254
  type: StringConstructor;
200
255
  default: undefined;
201
256
  };
257
+ /**
258
+ * The formats the editor offers, read when the editor is created. A format left out has no toolbar button,
259
+ * shortcut or input rule; pasted and incoming content keeps its text without it, and the markdown does not write it.
260
+ * @default ["bold", "italic", "orderedList", "bulletList", "link"]
261
+ */
262
+ formats: {
263
+ type: PropType<MarkdownEditorFormat[]>;
264
+ default: undefined;
265
+ };
266
+ /**
267
+ * A single newline is a line break, read and written as one "\n", read when the editor is created. Without it a
268
+ * line break is written as a backslash and a newline, and a single newline joins the lines. @default false
269
+ */
270
+ breaks: {
271
+ type: BooleanConstructor;
272
+ default: boolean;
273
+ };
202
274
  /** Minimum visible rows. @default 1 */
203
275
  rows: {
204
276
  type: NumberConstructor;
@@ -228,6 +300,7 @@ export declare const MarkdownEditor: import("vue").DefineComponent<import("vue")
228
300
  variant: "soft" | "outline";
229
301
  ariaInvalid: boolean;
230
302
  rows: number;
303
+ formats: MarkdownEditorFormat[];
304
+ breaks: boolean;
231
305
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
232
306
  export type MarkdownEditorProps = InstanceType<typeof MarkdownEditorComponent>["$props"];
233
- export {};
@@ -1 +1 @@
1
- export { MarkdownEditor, markdownEditorStyles, type MarkdownEditorProps } from "./MarkdownEditor.js";
1
+ export { MarkdownEditor, markdownEditorStyles, type MarkdownEditorFormat, type MarkdownEditorProps } from "./MarkdownEditor.js";
@@ -39,7 +39,10 @@ declare const TabComponent: import("vue").DefineComponent<import("vue").ExtractP
39
39
  };
40
40
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
41
41
  [key: string]: any;
42
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
42
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
+ /** A click, before the tab is selected; `event.preventDefault()` keeps the selection */
44
+ click: (event: MouseEvent) => true;
45
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
43
46
  /** Tab value */
44
47
  value: {
45
48
  type: StringConstructor;
@@ -61,7 +64,9 @@ declare const TabComponent: import("vue").DefineComponent<import("vue").ExtractP
61
64
  type: BooleanConstructor;
62
65
  default: undefined;
63
66
  };
64
- }>> & Readonly<{}>, {
67
+ }>> & Readonly<{
68
+ onClick?: ((event: MouseEvent) => any) | undefined;
69
+ }>, {
65
70
  disabled: boolean;
66
71
  badge: TabsBadgeProp;
67
72
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,154 @@
1
+ import { type PropType } from "vue";
2
+ import type { ControlSize, SemanticColors } from "@plexui/styles/types";
3
+ type ToggleGroupColor = SemanticColors<"primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning">;
4
+ /**
5
+ * A row of buttons that each stay pressed or not, any number at a time, such as the days an alarm repeats on.
6
+ * For one choice out of several, use SegmentedControl or RadioGroup.
7
+ */
8
+ export declare const ToggleGroup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
+ /** The values of the pressed items (controlled). Bind with `v-model:value`. */
10
+ value: {
11
+ type: PropType<string[]>;
12
+ default: undefined;
13
+ };
14
+ /** The values of the items pressed when the group is first rendered (uncontrolled). @default [] */
15
+ defaultValue: {
16
+ type: PropType<string[]>;
17
+ default: () => never[];
18
+ };
19
+ /** The fill of a pressed item, a solid button in this color. An item that is not pressed is a soft secondary button. @default "primary" */
20
+ color: {
21
+ type: PropType<ToggleGroupColor>;
22
+ default: string;
23
+ };
24
+ /** The size of the items, as the Button sizes. @default "md" */
25
+ size: {
26
+ type: PropType<ControlSize>;
27
+ default: string;
28
+ };
29
+ /** Fully rounded items. With `uniform`, each item is a circle. @default false */
30
+ pill: {
31
+ type: BooleanConstructor;
32
+ default: boolean;
33
+ };
34
+ /** Items as wide as they are tall, for a letter or an icon. @default false */
35
+ uniform: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
39
+ /** Fills the width of its container and spreads the items across it, the first and the last at the edges. @default false */
40
+ block: {
41
+ type: BooleanConstructor;
42
+ default: boolean;
43
+ };
44
+ /** Disables every item. @default false */
45
+ disabled: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
49
+ /** The reading direction of the items, which the arrow keys follow. @default "ltr" */
50
+ dir: {
51
+ type: PropType<"ltr" | "rtl">;
52
+ default: undefined;
53
+ };
54
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
55
+ [key: string]: any;
56
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
+ /** The pressed items changed */
58
+ "update:value": (value: string[]) => boolean;
59
+ /** The pressed items changed (React `onChange`), a newly pressed one last */
60
+ change: (value: string[]) => boolean;
61
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
62
+ /** The values of the pressed items (controlled). Bind with `v-model:value`. */
63
+ value: {
64
+ type: PropType<string[]>;
65
+ default: undefined;
66
+ };
67
+ /** The values of the items pressed when the group is first rendered (uncontrolled). @default [] */
68
+ defaultValue: {
69
+ type: PropType<string[]>;
70
+ default: () => never[];
71
+ };
72
+ /** The fill of a pressed item, a solid button in this color. An item that is not pressed is a soft secondary button. @default "primary" */
73
+ color: {
74
+ type: PropType<ToggleGroupColor>;
75
+ default: string;
76
+ };
77
+ /** The size of the items, as the Button sizes. @default "md" */
78
+ size: {
79
+ type: PropType<ControlSize>;
80
+ default: string;
81
+ };
82
+ /** Fully rounded items. With `uniform`, each item is a circle. @default false */
83
+ pill: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ /** Items as wide as they are tall, for a letter or an icon. @default false */
88
+ uniform: {
89
+ type: BooleanConstructor;
90
+ default: boolean;
91
+ };
92
+ /** Fills the width of its container and spreads the items across it, the first and the last at the edges. @default false */
93
+ block: {
94
+ type: BooleanConstructor;
95
+ default: boolean;
96
+ };
97
+ /** Disables every item. @default false */
98
+ disabled: {
99
+ type: BooleanConstructor;
100
+ default: boolean;
101
+ };
102
+ /** The reading direction of the items, which the arrow keys follow. @default "ltr" */
103
+ dir: {
104
+ type: PropType<"ltr" | "rtl">;
105
+ default: undefined;
106
+ };
107
+ }>> & Readonly<{
108
+ onChange?: ((value: string[]) => any) | undefined;
109
+ "onUpdate:value"?: ((value: string[]) => any) | undefined;
110
+ }>, {
111
+ value: string[];
112
+ defaultValue: string[];
113
+ disabled: boolean;
114
+ dir: "ltr" | "rtl";
115
+ size: "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
116
+ color: "primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning";
117
+ block: boolean;
118
+ pill: boolean;
119
+ uniform: boolean;
120
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
121
+ /** One button of a ToggleGroup, pressed while its `value` is in the group's value. */
122
+ export declare const ToggleGroupItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
123
+ /** The value of the item, in the group's `value` while it is pressed. */
124
+ value: {
125
+ type: StringConstructor;
126
+ required: true;
127
+ };
128
+ /** Disables the item. @default false */
129
+ disabled: {
130
+ type: BooleanConstructor;
131
+ default: boolean;
132
+ };
133
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
134
+ [key: string]: any;
135
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
136
+ /** A click, before the item is pressed or released; `event.preventDefault()` keeps it as it is */
137
+ click: (event: MouseEvent) => true;
138
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
139
+ /** The value of the item, in the group's `value` while it is pressed. */
140
+ value: {
141
+ type: StringConstructor;
142
+ required: true;
143
+ };
144
+ /** Disables the item. @default false */
145
+ disabled: {
146
+ type: BooleanConstructor;
147
+ default: boolean;
148
+ };
149
+ }>> & Readonly<{
150
+ onClick?: ((event: MouseEvent) => any) | undefined;
151
+ }>, {
152
+ disabled: boolean;
153
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
154
+ export {};
@@ -0,0 +1 @@
1
+ export { ToggleGroup, ToggleGroupItem } from "./ToggleGroup.js";
@@ -0,0 +1,47 @@
1
+ import type { AnyExtension } from "@tiptap/core";
2
+ export type MarkdownEditorFormat = "bold" | "italic" | "orderedList" | "bulletList" | "link";
3
+ export declare const MARKDOWN_EDITOR_FORMATS: readonly MarkdownEditorFormat[];
4
+ export type MarkdownEditorSchema = {
5
+ /** The formats the editor offers: a toolbar button, its shortcut and input rule, and a mark or node in the schema */
6
+ formats: ReadonlySet<MarkdownEditorFormat>;
7
+ /** A single newline is a line break, read and written as one "\n" */
8
+ breaks: boolean;
9
+ };
10
+ export declare const markdownEditorSchema: (formats?: readonly MarkdownEditorFormat[], breaks?: boolean) => MarkdownEditorSchema;
11
+ /**
12
+ * The editor's extensions. A format left out has no mark or node: its shortcut and input rule are gone, and pasted or
13
+ * incoming content keeps its text without it, so the markdown going out does not write it either.
14
+ */
15
+ export declare const markdownEditorExtensions: ({ formats, breaks }: MarkdownEditorSchema, placeholder?: string) => AnyExtension[];
16
+ type MarkdownNode = {
17
+ type: string;
18
+ value?: string;
19
+ position?: {
20
+ start: {
21
+ offset?: number;
22
+ };
23
+ end: {
24
+ offset?: number;
25
+ };
26
+ };
27
+ children?: MarkdownNode[];
28
+ };
29
+ type HtmlNode = {
30
+ type: string;
31
+ tagName?: string;
32
+ value?: string;
33
+ properties?: Record<string, unknown>;
34
+ children?: HtmlNode[];
35
+ };
36
+ export declare function remarkWithoutHtml(this: {
37
+ data(): object;
38
+ }): void;
39
+ export declare function remarkLineBreaks(): (tree: MarkdownNode, file: {
40
+ value?: unknown;
41
+ }) => void;
42
+ /**
43
+ * The first frame's HTML in the editor's schema. A document left with no block is the empty paragraph ProseMirror
44
+ * gives it, with the placeholder the editor would show (`placeholder` only while it can be edited).
45
+ */
46
+ export declare const rehypeEditorSchema: ({ formats }: MarkdownEditorSchema, placeholder?: string) => () => (tree: HtmlNode) => void;
47
+ export {};
@@ -0,0 +1,51 @@
1
+ import { type Component, type PropType, type Ref } from "vue";
2
+ export declare const focusFirst: (candidates: HTMLElement[]) => void;
3
+ export declare const callHandlers: (handlers: unknown, event: Event) => void;
4
+ export declare const isPrevented: (event: Event) => boolean;
5
+ export declare const callCallerHandlers: (handlers: unknown, event: Event) => void;
6
+ export declare const RovingElement: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
+ /** The element, or a component that renders one (such as Button) */
8
+ as: {
9
+ type: PropType<string | Component>;
10
+ required: true;
11
+ };
12
+ elementRef: PropType<Ref<HTMLElement | null>>;
13
+ /** Events whose Reka handler Radix composes after the caller's */
14
+ composed: {
15
+ type: PropType<string[]>;
16
+ required: true;
17
+ };
18
+ /** The caller's listeners for the `composed` events */
19
+ listeners: {
20
+ type: PropType<Record<string, unknown>>;
21
+ default: () => {};
22
+ };
23
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
24
+ [key: string]: any;
25
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ /** The element, or a component that renders one (such as Button) */
27
+ as: {
28
+ type: PropType<string | Component>;
29
+ required: true;
30
+ };
31
+ elementRef: PropType<Ref<HTMLElement | null>>;
32
+ /** Events whose Reka handler Radix composes after the caller's */
33
+ composed: {
34
+ type: PropType<string[]>;
35
+ required: true;
36
+ };
37
+ /** The caller's listeners for the `composed` events */
38
+ listeners: {
39
+ type: PropType<Record<string, unknown>>;
40
+ default: () => {};
41
+ };
42
+ }>> & Readonly<{}>, {
43
+ listeners: Record<string, unknown>;
44
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
45
+ /** Splits the caller's listeners for `keys`, `.once` ones (`onFocusOnce`) too, from the other attributes. */
46
+ export declare const splitListeners: (attrs: Record<string, unknown>, keys: string[]) => {
47
+ listeners: Record<string, unknown>;
48
+ rest: Record<string, unknown>;
49
+ };
50
+ export declare const GROUP_COMPOSED: string[];
51
+ export declare const ITEM_COMPOSED: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/vue",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "@maskito/core": "5.2.2",
78
78
  "@maskito/kit": "5.2.2",
79
79
  "@maskito/vue": "5.2.2",
80
- "@plexui/styles": "^0.1.42",
80
+ "@plexui/styles": "^0.1.44",
81
81
  "@tanstack/table-core": "8.21.3",
82
82
  "@tanstack/vue-table": "8.21.3",
83
83
  "@tiptap/core": "3.21.0",