@nexxtmove/ui 1.37.0 → 1.39.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/dist/components/editor/molecules/EditorAlignItems/EditorAlignItems.vue.d.ts +18 -3
- package/dist/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue.d.ts +15 -3
- package/dist/components/editor/molecules/EditorBorder/EditorBorder.vue.d.ts +11 -6
- package/dist/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue.d.ts +13 -3
- package/dist/components/editor/molecules/EditorGap/EditorGap.vue.d.ts +55 -6
- package/dist/components/editor/molecules/EditorHeadingType/EditorHeadingType.vue.d.ts +16 -12
- package/dist/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue.d.ts +18 -3
- package/dist/components/editor/molecules/EditorPadding/EditorPadding.vue.d.ts +106 -0
- package/dist/components/editor/molecules/EditorTextAlign/EditorTextAlign.vue.d.ts +18 -3
- package/dist/components/molecules/Tree/Tree.vue.d.ts +25 -0
- package/dist/components/molecules/Tree/tree-drop.d.ts +81 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +5475 -5085
- package/package.json +1 -1
- package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.vue +35 -11
- package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue +33 -6
- package/src/components/editor/molecules/EditorBorder/EditorBorder.vue +19 -12
- package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue +40 -5
- package/src/components/editor/molecules/EditorGap/EditorGap.vue +30 -15
- package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.vue +19 -15
- package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue +35 -15
- package/src/components/editor/molecules/EditorPadding/EditorPadding.vue +61 -19
- package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.vue +35 -7
- package/src/components/molecules/Tree/Tree.vue +573 -72
- package/src/components/molecules/Tree/tree-drop.ts +155 -0
- package/src/index.ts +14 -1
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The options the editor offers, in the order they are shown. `token` is the
|
|
3
|
+
* class without its fixed `items-` prefix, so the class is `items-` plus the
|
|
4
|
+
* token. The labels are not in here; they arrive through `messages`, keyed by
|
|
5
|
+
* token.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EDITOR_ALIGN_ITEMS_OPTIONS: readonly [{
|
|
8
|
+
readonly token: "start";
|
|
9
|
+
}, {
|
|
10
|
+
readonly token: "center";
|
|
11
|
+
}, {
|
|
12
|
+
readonly token: "end";
|
|
13
|
+
}, {
|
|
14
|
+
readonly token: "stretch";
|
|
15
|
+
}];
|
|
1
16
|
/**
|
|
2
17
|
* The cross-axis alignment as the editor needs it: the Tailwind class itself,
|
|
3
18
|
* so the consumer can put the model value straight on the element it styles.
|
|
4
19
|
*/
|
|
5
|
-
export type EditorAlignItemsValue =
|
|
20
|
+
export type EditorAlignItemsValue = `items-${(typeof EDITOR_ALIGN_ITEMS_OPTIONS)[number]['token']}`;
|
|
6
21
|
/** Overridable copy for the four options. Every key is optional. */
|
|
7
22
|
export interface EditorAlignItemsMessages {
|
|
8
23
|
/** Accessible name of the `items-start` option. Defaults to `'Begin'`. */
|
|
@@ -35,10 +50,10 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorAlignItemsP
|
|
|
35
50
|
/** The selected alignment, as the Tailwind class to apply. */
|
|
36
51
|
modelValue: EditorAlignItemsValue;
|
|
37
52
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
38
|
-
"update:modelValue": (value:
|
|
53
|
+
"update:modelValue": (value: "items-center" | "items-end" | "items-start" | "items-stretch") => any;
|
|
39
54
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorAlignItemsProps & {
|
|
40
55
|
/** The selected alignment, as the Tailwind class to apply. */
|
|
41
56
|
modelValue: EditorAlignItemsValue;
|
|
42
57
|
}> & Readonly<{
|
|
43
|
-
"onUpdate:modelValue"?: ((value:
|
|
58
|
+
"onUpdate:modelValue"?: ((value: "items-center" | "items-end" | "items-start" | "items-stretch") => any) | undefined;
|
|
44
59
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The options the editor offers, in the order they are shown. `token` is the
|
|
3
|
+
* class without its fixed `bg-` prefix, so the class is `bg-` plus the token.
|
|
4
|
+
* The labels are not in here; they arrive through `messages`, keyed by token.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EDITOR_BACKGROUND_SIZE_OPTIONS: readonly [{
|
|
7
|
+
readonly token: "cover";
|
|
8
|
+
}, {
|
|
9
|
+
readonly token: "contain";
|
|
10
|
+
}, {
|
|
11
|
+
readonly token: "auto";
|
|
12
|
+
}];
|
|
1
13
|
/**
|
|
2
14
|
* The background size as the editor needs it: the Tailwind class itself, so the
|
|
3
15
|
* consumer can put the model value straight on the element it styles.
|
|
4
16
|
*/
|
|
5
|
-
export type EditorBackgroundSizeValue =
|
|
17
|
+
export type EditorBackgroundSizeValue = `bg-${(typeof EDITOR_BACKGROUND_SIZE_OPTIONS)[number]['token']}`;
|
|
6
18
|
/** Overridable copy for the three options. Every key is optional. */
|
|
7
19
|
export interface EditorBackgroundSizeMessages {
|
|
8
20
|
/** Accessible name of the `bg-cover` option. Defaults to `'Opvullen'`. */
|
|
@@ -33,10 +45,10 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorBackgroundS
|
|
|
33
45
|
/** The selected background size, as the Tailwind class to apply. */
|
|
34
46
|
modelValue: EditorBackgroundSizeValue;
|
|
35
47
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
36
|
-
"update:modelValue": (value:
|
|
48
|
+
"update:modelValue": (value: "bg-auto" | "bg-cover" | "bg-contain") => any;
|
|
37
49
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorBackgroundSizeProps & {
|
|
38
50
|
/** The selected background size, as the Tailwind class to apply. */
|
|
39
51
|
modelValue: EditorBackgroundSizeValue;
|
|
40
52
|
}> & Readonly<{
|
|
41
|
-
"onUpdate:modelValue"?: ((value:
|
|
53
|
+
"onUpdate:modelValue"?: ((value: "bg-auto" | "bg-cover" | "bg-contain") => any) | undefined;
|
|
42
54
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -4,22 +4,27 @@
|
|
|
4
4
|
* rather than theme tokens -- the theme defines no border-width scale, so
|
|
5
5
|
* stepping over arbitrary integers would produce classes with no CSS behind
|
|
6
6
|
* them.
|
|
7
|
+
*
|
|
8
|
+
* `token` is the full width class, not a suffix: the 1px step is the bare
|
|
9
|
+
* `border`, which has none. The model value pairs it with an optional colour
|
|
10
|
+
* class; a value without a width class on the list puts the slider on the first
|
|
11
|
+
* step.
|
|
7
12
|
*/
|
|
8
|
-
declare const
|
|
9
|
-
readonly
|
|
13
|
+
export declare const EDITOR_BORDER_STEPS: readonly [{
|
|
14
|
+
readonly token: "border";
|
|
10
15
|
readonly px: 1;
|
|
11
16
|
}, {
|
|
12
|
-
readonly
|
|
17
|
+
readonly token: "border-2";
|
|
13
18
|
readonly px: 2;
|
|
14
19
|
}, {
|
|
15
|
-
readonly
|
|
20
|
+
readonly token: "border-4";
|
|
16
21
|
readonly px: 4;
|
|
17
22
|
}, {
|
|
18
|
-
readonly
|
|
23
|
+
readonly token: "border-8";
|
|
19
24
|
readonly px: 8;
|
|
20
25
|
}];
|
|
21
26
|
/** The width part of the model value, as the Tailwind class itself. */
|
|
22
|
-
export type EditorBorderWidth = (typeof
|
|
27
|
+
export type EditorBorderWidth = (typeof EDITOR_BORDER_STEPS)[number]['token'];
|
|
23
28
|
/** Overridable copy of the readout and the picker. Every key is optional. */
|
|
24
29
|
export interface EditorBorderMessages {
|
|
25
30
|
/** Unit shown behind the width. Defaults to `'px'`. */
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The options the editor offers, in the order they are shown. `token` is the
|
|
3
|
+
* class without its fixed `flex-` prefix, so the class is `flex-` plus the
|
|
4
|
+
* token. The labels are not in here; they arrive through `messages`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EDITOR_FLEX_DIRECTION_OPTIONS: readonly [{
|
|
7
|
+
readonly token: "row";
|
|
8
|
+
}, {
|
|
9
|
+
readonly token: "col";
|
|
10
|
+
}];
|
|
1
11
|
/**
|
|
2
12
|
* The flex direction as the editor needs it: the Tailwind class itself, so the
|
|
3
13
|
* consumer can put the model value straight on the element it styles.
|
|
4
14
|
*/
|
|
5
|
-
export type EditorFlexDirectionValue =
|
|
15
|
+
export type EditorFlexDirectionValue = `flex-${(typeof EDITOR_FLEX_DIRECTION_OPTIONS)[number]['token']}`;
|
|
6
16
|
/** Overridable copy for the two options. Every key is optional. */
|
|
7
17
|
export interface EditorFlexDirectionMessages {
|
|
8
18
|
/** Label of the `flex-row` option. Defaults to `'Horizontaal'`. */
|
|
@@ -30,10 +40,10 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorFlexDirecti
|
|
|
30
40
|
/** The selected direction, as the Tailwind class to apply. */
|
|
31
41
|
modelValue: EditorFlexDirectionValue;
|
|
32
42
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
33
|
-
"update:modelValue": (value:
|
|
43
|
+
"update:modelValue": (value: "flex-col" | "flex-row") => any;
|
|
34
44
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorFlexDirectionProps & {
|
|
35
45
|
/** The selected direction, as the Tailwind class to apply. */
|
|
36
46
|
modelValue: EditorFlexDirectionValue;
|
|
37
47
|
}> & Readonly<{
|
|
38
|
-
"onUpdate:modelValue"?: ((value:
|
|
48
|
+
"onUpdate:modelValue"?: ((value: "flex-col" | "flex-row") => any) | undefined;
|
|
39
49
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,15 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The steps the slider can land on,
|
|
3
|
-
* 13 and 15 are missing on purpose:
|
|
4
|
-
* `--spacing-12` and then only 14 and
|
|
5
|
-
* of over this list would offer gaps
|
|
2
|
+
* The steps the slider can land on, with the px they render (the spacing scale
|
|
3
|
+
* is built on 0.25rem, so a step is 4 px). 13 and 15 are missing on purpose:
|
|
4
|
+
* the theme defines `--spacing-0` through `--spacing-12` and then only 14 and
|
|
5
|
+
* 16, so stepping over the px value instead of over this list would offer gaps
|
|
6
|
+
* that have no token behind them.
|
|
7
|
+
*
|
|
8
|
+
* `token` is the numeric part of the class; the class is `gap-` plus the token.
|
|
9
|
+
* A stored value that is not on the list puts the slider on the first step.
|
|
6
10
|
*/
|
|
7
|
-
declare const
|
|
11
|
+
export declare const EDITOR_GAP_STEPS: readonly [{
|
|
12
|
+
readonly token: 0;
|
|
13
|
+
readonly px: 0;
|
|
14
|
+
}, {
|
|
15
|
+
readonly token: 1;
|
|
16
|
+
readonly px: 4;
|
|
17
|
+
}, {
|
|
18
|
+
readonly token: 2;
|
|
19
|
+
readonly px: 8;
|
|
20
|
+
}, {
|
|
21
|
+
readonly token: 3;
|
|
22
|
+
readonly px: 12;
|
|
23
|
+
}, {
|
|
24
|
+
readonly token: 4;
|
|
25
|
+
readonly px: 16;
|
|
26
|
+
}, {
|
|
27
|
+
readonly token: 5;
|
|
28
|
+
readonly px: 20;
|
|
29
|
+
}, {
|
|
30
|
+
readonly token: 6;
|
|
31
|
+
readonly px: 24;
|
|
32
|
+
}, {
|
|
33
|
+
readonly token: 7;
|
|
34
|
+
readonly px: 28;
|
|
35
|
+
}, {
|
|
36
|
+
readonly token: 8;
|
|
37
|
+
readonly px: 32;
|
|
38
|
+
}, {
|
|
39
|
+
readonly token: 9;
|
|
40
|
+
readonly px: 36;
|
|
41
|
+
}, {
|
|
42
|
+
readonly token: 10;
|
|
43
|
+
readonly px: 40;
|
|
44
|
+
}, {
|
|
45
|
+
readonly token: 11;
|
|
46
|
+
readonly px: 44;
|
|
47
|
+
}, {
|
|
48
|
+
readonly token: 12;
|
|
49
|
+
readonly px: 48;
|
|
50
|
+
}, {
|
|
51
|
+
readonly token: 14;
|
|
52
|
+
readonly px: 56;
|
|
53
|
+
}, {
|
|
54
|
+
readonly token: 16;
|
|
55
|
+
readonly px: 64;
|
|
56
|
+
}];
|
|
8
57
|
/**
|
|
9
58
|
* The gap as the editor needs it: the Tailwind class itself, so the consumer
|
|
10
59
|
* can put the model value straight on the element it styles.
|
|
11
60
|
*/
|
|
12
|
-
export type EditorGapValue = `gap-${(typeof
|
|
61
|
+
export type EditorGapValue = `gap-${(typeof EDITOR_GAP_STEPS)[number]['token']}`;
|
|
13
62
|
/** Overridable copy of the value readout. Every key is optional. */
|
|
14
63
|
export interface EditorGapMessages {
|
|
15
64
|
/** Unit shown behind the value. Defaults to `'px'`. */
|
|
@@ -1,35 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The heading levels the editor offers, in the order they are listed. The level
|
|
3
|
-
* is what the option shows -- its label and its `h1`..`h6` icon -- and the
|
|
4
|
-
* is what the model carries. The sizes are Tailwind's default scale on
|
|
5
|
-
* not the theme's `heading-*` utilities: this value is data the editor
|
|
6
|
-
* and puts back on an element, so it has to be a class every consumer
|
|
3
|
+
* is what the option shows -- its label and its `h1`..`h6` icon -- and the
|
|
4
|
+
* token is what the model carries. The sizes are Tailwind's default scale on
|
|
5
|
+
* purpose, not the theme's `heading-*` utilities: this value is data the editor
|
|
6
|
+
* stores and puts back on an element, so it has to be a class every consumer
|
|
7
|
+
* resolves.
|
|
8
|
+
*
|
|
9
|
+
* `token` is the full font-size class, not a suffix: it is stored as is. The
|
|
10
|
+
* labels are not in here; they arrive through `messages`, keyed by level.
|
|
7
11
|
*/
|
|
8
|
-
declare const
|
|
12
|
+
export declare const EDITOR_HEADING_TYPE_OPTIONS: readonly [{
|
|
13
|
+
readonly token: "text-4xl";
|
|
9
14
|
readonly level: 1;
|
|
10
|
-
readonly size: "text-4xl";
|
|
11
15
|
}, {
|
|
16
|
+
readonly token: "text-3xl";
|
|
12
17
|
readonly level: 2;
|
|
13
|
-
readonly size: "text-3xl";
|
|
14
18
|
}, {
|
|
19
|
+
readonly token: "text-2xl";
|
|
15
20
|
readonly level: 3;
|
|
16
|
-
readonly size: "text-2xl";
|
|
17
21
|
}, {
|
|
22
|
+
readonly token: "text-xl";
|
|
18
23
|
readonly level: 4;
|
|
19
|
-
readonly size: "text-xl";
|
|
20
24
|
}, {
|
|
25
|
+
readonly token: "text-lg";
|
|
21
26
|
readonly level: 5;
|
|
22
|
-
readonly size: "text-lg";
|
|
23
27
|
}, {
|
|
28
|
+
readonly token: "text-base";
|
|
24
29
|
readonly level: 6;
|
|
25
|
-
readonly size: "text-base";
|
|
26
30
|
}];
|
|
27
31
|
/**
|
|
28
32
|
* The heading as the editor needs it: the Tailwind font-size class itself, so
|
|
29
33
|
* the consumer can put the model value straight on the element it styles.
|
|
30
34
|
* Weight is deliberately not part of it -- that becomes a setting of its own.
|
|
31
35
|
*/
|
|
32
|
-
export type EditorHeadingTypeValue = (typeof
|
|
36
|
+
export type EditorHeadingTypeValue = (typeof EDITOR_HEADING_TYPE_OPTIONS)[number]['token'];
|
|
33
37
|
/** Overridable copy for the six options. Every key is optional. */
|
|
34
38
|
export interface EditorHeadingTypeMessages {
|
|
35
39
|
/** Label of the `h1` option. Defaults to `'Heading 1'`. */
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The options the editor offers, in the order they are shown. `token` is the
|
|
3
|
+
* class without its fixed `justify-` prefix, so the class is `justify-` plus
|
|
4
|
+
* the token. The labels are not in here; they arrive through `messages`, keyed
|
|
5
|
+
* by token.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EDITOR_JUSTIFY_CONTENT_OPTIONS: readonly [{
|
|
8
|
+
readonly token: "start";
|
|
9
|
+
}, {
|
|
10
|
+
readonly token: "center";
|
|
11
|
+
}, {
|
|
12
|
+
readonly token: "end";
|
|
13
|
+
}, {
|
|
14
|
+
readonly token: "between";
|
|
15
|
+
}];
|
|
1
16
|
/**
|
|
2
17
|
* The justification as the editor needs it: the Tailwind class itself, so the
|
|
3
18
|
* consumer can put the model value straight on the element it styles.
|
|
4
19
|
*/
|
|
5
|
-
export type EditorJustifyContentValue =
|
|
20
|
+
export type EditorJustifyContentValue = `justify-${(typeof EDITOR_JUSTIFY_CONTENT_OPTIONS)[number]['token']}`;
|
|
6
21
|
/** Overridable copy for the four options. Every key is optional. */
|
|
7
22
|
export interface EditorJustifyContentMessages {
|
|
8
23
|
/** Accessible name of the `justify-start` option. Defaults to `'Begin'`. */
|
|
@@ -35,10 +50,10 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorJustifyCont
|
|
|
35
50
|
/** The selected justification, as the Tailwind class to apply. */
|
|
36
51
|
modelValue: EditorJustifyContentValue;
|
|
37
52
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
38
|
-
"update:modelValue": (value:
|
|
53
|
+
"update:modelValue": (value: "justify-center" | "justify-end" | "justify-start" | "justify-between") => any;
|
|
39
54
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorJustifyContentProps & {
|
|
40
55
|
/** The selected justification, as the Tailwind class to apply. */
|
|
41
56
|
modelValue: EditorJustifyContentValue;
|
|
42
57
|
}> & Readonly<{
|
|
43
|
-
"onUpdate:modelValue"?: ((value:
|
|
58
|
+
"onUpdate:modelValue"?: ((value: "justify-center" | "justify-end" | "justify-start" | "justify-between") => any) | undefined;
|
|
44
59
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,3 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The steps a field can land on: every integer `--spacing-*` token the theme
|
|
3
|
+
* defines, with the px it renders (the spacing scale is built on 0.25rem, so a
|
|
4
|
+
* step is 4 px). The list thins out as it climbs -- 13 and 15 are absent, and
|
|
5
|
+
* past 16 it moves in fours and then eights -- so snapping over this list
|
|
6
|
+
* rather than over the px value keeps the field off classes that have no token
|
|
7
|
+
* behind them.
|
|
8
|
+
*
|
|
9
|
+
* `token` is the numeric part of the class, without a prefix: one padding value
|
|
10
|
+
* is written with several of them (`p-`, `px-`, `py-`, `pt-`, `pr-`, `pb-`,
|
|
11
|
+
* `pl-`), so the full class depends on which sides it covers. A value between
|
|
12
|
+
* two steps snaps to the nearest one, the lower on a tie.
|
|
13
|
+
*/
|
|
14
|
+
export declare const EDITOR_PADDING_STEPS: readonly [{
|
|
15
|
+
readonly token: 0;
|
|
16
|
+
readonly px: 0;
|
|
17
|
+
}, {
|
|
18
|
+
readonly token: 1;
|
|
19
|
+
readonly px: 4;
|
|
20
|
+
}, {
|
|
21
|
+
readonly token: 2;
|
|
22
|
+
readonly px: 8;
|
|
23
|
+
}, {
|
|
24
|
+
readonly token: 3;
|
|
25
|
+
readonly px: 12;
|
|
26
|
+
}, {
|
|
27
|
+
readonly token: 4;
|
|
28
|
+
readonly px: 16;
|
|
29
|
+
}, {
|
|
30
|
+
readonly token: 5;
|
|
31
|
+
readonly px: 20;
|
|
32
|
+
}, {
|
|
33
|
+
readonly token: 6;
|
|
34
|
+
readonly px: 24;
|
|
35
|
+
}, {
|
|
36
|
+
readonly token: 7;
|
|
37
|
+
readonly px: 28;
|
|
38
|
+
}, {
|
|
39
|
+
readonly token: 8;
|
|
40
|
+
readonly px: 32;
|
|
41
|
+
}, {
|
|
42
|
+
readonly token: 9;
|
|
43
|
+
readonly px: 36;
|
|
44
|
+
}, {
|
|
45
|
+
readonly token: 10;
|
|
46
|
+
readonly px: 40;
|
|
47
|
+
}, {
|
|
48
|
+
readonly token: 11;
|
|
49
|
+
readonly px: 44;
|
|
50
|
+
}, {
|
|
51
|
+
readonly token: 12;
|
|
52
|
+
readonly px: 48;
|
|
53
|
+
}, {
|
|
54
|
+
readonly token: 14;
|
|
55
|
+
readonly px: 56;
|
|
56
|
+
}, {
|
|
57
|
+
readonly token: 16;
|
|
58
|
+
readonly px: 64;
|
|
59
|
+
}, {
|
|
60
|
+
readonly token: 20;
|
|
61
|
+
readonly px: 80;
|
|
62
|
+
}, {
|
|
63
|
+
readonly token: 24;
|
|
64
|
+
readonly px: 96;
|
|
65
|
+
}, {
|
|
66
|
+
readonly token: 28;
|
|
67
|
+
readonly px: 112;
|
|
68
|
+
}, {
|
|
69
|
+
readonly token: 32;
|
|
70
|
+
readonly px: 128;
|
|
71
|
+
}, {
|
|
72
|
+
readonly token: 36;
|
|
73
|
+
readonly px: 144;
|
|
74
|
+
}, {
|
|
75
|
+
readonly token: 40;
|
|
76
|
+
readonly px: 160;
|
|
77
|
+
}, {
|
|
78
|
+
readonly token: 44;
|
|
79
|
+
readonly px: 176;
|
|
80
|
+
}, {
|
|
81
|
+
readonly token: 48;
|
|
82
|
+
readonly px: 192;
|
|
83
|
+
}, {
|
|
84
|
+
readonly token: 52;
|
|
85
|
+
readonly px: 208;
|
|
86
|
+
}, {
|
|
87
|
+
readonly token: 56;
|
|
88
|
+
readonly px: 224;
|
|
89
|
+
}, {
|
|
90
|
+
readonly token: 60;
|
|
91
|
+
readonly px: 240;
|
|
92
|
+
}, {
|
|
93
|
+
readonly token: 64;
|
|
94
|
+
readonly px: 256;
|
|
95
|
+
}, {
|
|
96
|
+
readonly token: 72;
|
|
97
|
+
readonly px: 288;
|
|
98
|
+
}, {
|
|
99
|
+
readonly token: 80;
|
|
100
|
+
readonly px: 320;
|
|
101
|
+
}, {
|
|
102
|
+
readonly token: 96;
|
|
103
|
+
readonly px: 384;
|
|
104
|
+
}];
|
|
105
|
+
/** A padding step as the numeric part of the Tailwind class, as in `p-4`. */
|
|
106
|
+
export type EditorPaddingStep = (typeof EDITOR_PADDING_STEPS)[number]['token'];
|
|
1
107
|
/** Overridable copy of the field and toggle names. Every key is optional. */
|
|
2
108
|
export interface EditorPaddingMessages {
|
|
3
109
|
/** Accessible name of the collapsed left/right field. Defaults to `'Horizontaal'`. */
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The options the editor offers, in the order they are shown. `token` is the
|
|
3
|
+
* class without its fixed `text-` prefix, so the class is `text-` plus the
|
|
4
|
+
* token. The labels are not in here; they arrive through `messages`, keyed by
|
|
5
|
+
* token.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EDITOR_TEXT_ALIGN_OPTIONS: readonly [{
|
|
8
|
+
readonly token: "left";
|
|
9
|
+
}, {
|
|
10
|
+
readonly token: "center";
|
|
11
|
+
}, {
|
|
12
|
+
readonly token: "right";
|
|
13
|
+
}, {
|
|
14
|
+
readonly token: "justify";
|
|
15
|
+
}];
|
|
1
16
|
/**
|
|
2
17
|
* The text alignment as the editor needs it: the Tailwind class itself, so the
|
|
3
18
|
* consumer can put the model value straight on the element it styles.
|
|
4
19
|
*/
|
|
5
|
-
export type EditorTextAlignValue =
|
|
20
|
+
export type EditorTextAlignValue = `text-${(typeof EDITOR_TEXT_ALIGN_OPTIONS)[number]['token']}`;
|
|
6
21
|
/** Overridable copy for the four options. Every key is optional. */
|
|
7
22
|
export interface EditorTextAlignMessages {
|
|
8
23
|
/** Accessible name of the `text-left` option. Defaults to `'Links'`. */
|
|
@@ -35,10 +50,10 @@ declare const __VLS_export: import('vue').DefineComponent<NexxtEditorTextAlignPr
|
|
|
35
50
|
/** The selected text alignment, as the Tailwind class to apply. */
|
|
36
51
|
modelValue: EditorTextAlignValue;
|
|
37
52
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
38
|
-
"update:modelValue": (value:
|
|
53
|
+
"update:modelValue": (value: "text-left" | "text-right" | "text-center" | "text-justify") => any;
|
|
39
54
|
}, string, import('vue').PublicProps, Readonly<NexxtEditorTextAlignProps & {
|
|
40
55
|
/** The selected text alignment, as the Tailwind class to apply. */
|
|
41
56
|
modelValue: EditorTextAlignValue;
|
|
42
57
|
}> & Readonly<{
|
|
43
|
-
"onUpdate:modelValue"?: ((value:
|
|
58
|
+
"onUpdate:modelValue"?: ((value: "text-left" | "text-right" | "text-center" | "text-justify") => any) | undefined;
|
|
44
59
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -6,12 +6,35 @@ export interface NexxtTreeNode {
|
|
|
6
6
|
icon?: NexxtIconName;
|
|
7
7
|
/** A node with children gets a chevron and can be folded. */
|
|
8
8
|
children?: NexxtTreeNode[];
|
|
9
|
+
/** Whether this node accepts drops when it currently has no children. */
|
|
10
|
+
canHaveChildren?: boolean;
|
|
11
|
+
/** Whether this node can be dragged when the tree's `draggable` prop is enabled. */
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface NexxtTreeMove {
|
|
15
|
+
/** The node being moved. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** The node that will contain the moved node, or `null` for the tree root. */
|
|
18
|
+
parentId: string | null;
|
|
19
|
+
/** The zero-based position in the target parent's children. */
|
|
20
|
+
index: number;
|
|
9
21
|
}
|
|
10
22
|
export interface NexxtTreeProps {
|
|
11
23
|
/** The top-level nodes; nest `children` for deeper levels. */
|
|
12
24
|
nodes: NexxtTreeNode[];
|
|
13
25
|
/** Accessible name for the tree, e.g. the heading above it. */
|
|
14
26
|
label: string;
|
|
27
|
+
/** Enables native drag-and-drop for rows and emits the intended new position. */
|
|
28
|
+
draggable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Decides per spot whether the dragged node may land there, on top of the built-in rules (no
|
|
31
|
+
* drop into its own subtree, only into nodes that can have children). Gets the same shape as
|
|
32
|
+
* the `move` payload. A refused spot shows no ghost row and drops nothing, like letting go
|
|
33
|
+
* outside the tree. It runs on every `dragover` — which the browser keeps firing while the
|
|
34
|
+
* pointer rests — and on every touch move, so keep it cheap and pure: the same spot must always
|
|
35
|
+
* get the same answer.
|
|
36
|
+
*/
|
|
37
|
+
canDrop?: (target: NexxtTreeMove) => boolean;
|
|
15
38
|
}
|
|
16
39
|
export type NexxtTreeSlots = {
|
|
17
40
|
/** Actions at the end of a row, e.g. a delete button. Hidden until the row is hovered or holds focus, and always shown on a coarse pointer. Clicks and keys inside it never reach the tree, so they neither select the row nor move focus. Put `tabindex` on every focusable element in it: it is `0` only on the row that is the tree's tab stop, which keeps one extra Tab stop for the whole tree. Keep the content at most 24px high, or the rows grow. */
|
|
@@ -31,9 +54,11 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
|
31
54
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
32
55
|
focusNode: (id: string) => Promise<boolean>;
|
|
33
56
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
57
|
+
move: (move: NexxtTreeMove) => any;
|
|
34
58
|
"update:selected": (value: string | null) => any;
|
|
35
59
|
"update:collapsed": (value: string[]) => any;
|
|
36
60
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
61
|
+
onMove?: ((move: NexxtTreeMove) => any) | undefined;
|
|
37
62
|
"onUpdate:selected"?: ((value: string | null) => any) | undefined;
|
|
38
63
|
"onUpdate:collapsed"?: ((value: string[]) => any) | undefined;
|
|
39
64
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { NexxtTreeNode } from './Tree.vue';
|
|
2
|
+
/** A visible row of the tree, in document order. */
|
|
3
|
+
export interface TreeRow {
|
|
4
|
+
node: NexxtTreeNode;
|
|
5
|
+
depth: number;
|
|
6
|
+
parentId: string | null;
|
|
7
|
+
expandable: boolean;
|
|
8
|
+
canHaveChildren: boolean;
|
|
9
|
+
draggable: boolean;
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
/** One-based position among its siblings. */
|
|
12
|
+
position: number;
|
|
13
|
+
setSize: number;
|
|
14
|
+
}
|
|
15
|
+
export type DropMarker = 'before' | 'inside' | 'after';
|
|
16
|
+
export interface TreeDrop {
|
|
17
|
+
/** The row the pointer was over when this spot was picked. */
|
|
18
|
+
rowId: string;
|
|
19
|
+
parentId: string | null;
|
|
20
|
+
index: number;
|
|
21
|
+
marker: DropMarker;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Where a row sits with the ghost row taken out, relative to the top of the tree. `bottom` takes
|
|
25
|
+
* in the gap below the row: a gap belongs to the row above it, so moving across it never reads
|
|
26
|
+
* as leaving the tree.
|
|
27
|
+
*/
|
|
28
|
+
export interface RestSlot {
|
|
29
|
+
id: string;
|
|
30
|
+
top: number;
|
|
31
|
+
height: number;
|
|
32
|
+
bottom: number;
|
|
33
|
+
}
|
|
34
|
+
export interface DropLayout {
|
|
35
|
+
slots: RestSlot[];
|
|
36
|
+
/** The ghost row as it is laid out now, gap included; `null` while there is none. */
|
|
37
|
+
ghost: {
|
|
38
|
+
top: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
} | null;
|
|
41
|
+
}
|
|
42
|
+
/** `keep` leaves the current spot as it is: the pointer is on the ghost row, or there are no rows. */
|
|
43
|
+
export type DropHit = {
|
|
44
|
+
kind: 'keep';
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'row';
|
|
47
|
+
id: string;
|
|
48
|
+
ratio: number;
|
|
49
|
+
};
|
|
50
|
+
export declare const containsNode: (node: NexxtTreeNode, id: string) => boolean;
|
|
51
|
+
export declare const findNode: (nodes: NexxtTreeNode[], id: string) => NexxtTreeNode | null;
|
|
52
|
+
/**
|
|
53
|
+
* Reads the pointer against where the rows land without the ghost row, not against what is under
|
|
54
|
+
* it now. The ghost pushes rows aside, so reading what is under the pointer would find a shifted
|
|
55
|
+
* row or the ghost itself, pick another spot, move the ghost and flicker. Measured this way the
|
|
56
|
+
* same pointer always gives the same answer, however the ghost moves.
|
|
57
|
+
*
|
|
58
|
+
* @param layout - The rows at rest and the ghost row as it is laid out now.
|
|
59
|
+
* @param y - The pointer, relative to the top of the tree.
|
|
60
|
+
*/
|
|
61
|
+
export declare const hitTest: ({ slots, ghost }: DropLayout, y: number) => DropHit;
|
|
62
|
+
/**
|
|
63
|
+
* The spot a pointer at `ratio` of `row` stands for. A group splits into before (top 30%),
|
|
64
|
+
* inside and after (bottom 30%), a leaf into before and after at the middle. Inside always lands
|
|
65
|
+
* as the first child, right under the group row, so the ghost shows up next to the pointer. The
|
|
66
|
+
* dragged node and everything inside it are no target at all.
|
|
67
|
+
*/
|
|
68
|
+
export declare const resolveDrop: (row: TreeRow, ratio: number, moving: NexxtTreeNode) => TreeDrop | null;
|
|
69
|
+
/** A spot where the dragged row already is: dropping there changes nothing, so it is no target. */
|
|
70
|
+
export declare const isNoOp: (drop: TreeDrop, source: TreeRow) => boolean;
|
|
71
|
+
/** Two spots are the same when they land the node in the same place, whichever row picked them. */
|
|
72
|
+
export declare const samePlace: (a: TreeDrop | null, b: TreeDrop | null) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Where the ghost row goes among the visible rows, and how deep. Right before the row of the
|
|
75
|
+
* sibling now at `index`, or after the last visible row inside the parent when `index` is past
|
|
76
|
+
* its last child. `null` for a spot inside a collapsed group: that group row marks itself.
|
|
77
|
+
*/
|
|
78
|
+
export declare const ghostSlot: (rows: TreeRow[], nodes: NexxtTreeNode[], drop: TreeDrop | null) => {
|
|
79
|
+
at: number;
|
|
80
|
+
depth: number;
|
|
81
|
+
} | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,18 +8,26 @@ export type { NexxtTabItem } from './components/molecules/Tabs/Tabs.vue';
|
|
|
8
8
|
export type { NexxtPageCardProps, NexxtPageCardSlots, } from './components/molecules/PageCard/PageCard.vue';
|
|
9
9
|
export type { NexxtPageMockupType } from './components/molecules/PageMockup/PageMockup.vue';
|
|
10
10
|
export type { NexxtPickerGroupData, NexxtPickerItemData, } from './components/molecules/PickerList/PickerList.vue';
|
|
11
|
-
export type { NexxtTreeNode, NexxtTreeProps, NexxtTreeSlots, } from './components/molecules/Tree/Tree.vue';
|
|
11
|
+
export type { NexxtTreeMove, NexxtTreeNode, NexxtTreeProps, NexxtTreeSlots, } from './components/molecules/Tree/Tree.vue';
|
|
12
12
|
export type { NexxtPlaceholderGroup, NexxtPlaceholderInputMessages, NexxtPlaceholderInputProps, } from './components/molecules/PlaceholderInput/PlaceholderInput.vue';
|
|
13
|
+
export { EDITOR_ALIGN_ITEMS_OPTIONS } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
|
|
13
14
|
export type { EditorAlignItemsMessages, EditorAlignItemsValue, } from './components/editor/molecules/EditorAlignItems/EditorAlignItems.vue';
|
|
15
|
+
export { EDITOR_BACKGROUND_SIZE_OPTIONS } from './components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue';
|
|
14
16
|
export type { EditorBackgroundSizeMessages, EditorBackgroundSizeValue, } from './components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue';
|
|
17
|
+
export { EDITOR_FLEX_DIRECTION_OPTIONS } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue';
|
|
15
18
|
export type { EditorFlexDirectionMessages, EditorFlexDirectionValue, } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue';
|
|
19
|
+
export { EDITOR_GAP_STEPS } from './components/editor/molecules/EditorGap/EditorGap.vue';
|
|
16
20
|
export type { EditorGapMessages, EditorGapValue, } from './components/editor/molecules/EditorGap/EditorGap.vue';
|
|
17
21
|
export type { EditorColorLiteralValue, EditorColorMessages, EditorColorProperty, EditorColorRole, EditorColorRoleValue, EditorColorThemeRole, EditorColorValue, } from './components/editor/molecules/EditorColor/EditorColor.vue';
|
|
22
|
+
export { EDITOR_BORDER_STEPS } from './components/editor/molecules/EditorBorder/EditorBorder.vue';
|
|
18
23
|
export type { EditorBorderMessages, EditorBorderWidth, } from './components/editor/molecules/EditorBorder/EditorBorder.vue';
|
|
24
|
+
export { EDITOR_HEADING_TYPE_OPTIONS } from './components/editor/molecules/EditorHeadingType/EditorHeadingType.vue';
|
|
19
25
|
export type { EditorHeadingTypeMessages, EditorHeadingTypeValue, } from './components/editor/molecules/EditorHeadingType/EditorHeadingType.vue';
|
|
20
26
|
export { EDITOR_RADIUS_STEPS } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
|
|
21
27
|
export type { EditorRadiusMessages, EditorRadiusValue, } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
|
|
28
|
+
export { EDITOR_TEXT_ALIGN_OPTIONS } from './components/editor/molecules/EditorTextAlign/EditorTextAlign.vue';
|
|
22
29
|
export type { EditorTextAlignMessages, EditorTextAlignValue, } from './components/editor/molecules/EditorTextAlign/EditorTextAlign.vue';
|
|
30
|
+
export { EDITOR_JUSTIFY_CONTENT_OPTIONS } from './components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue';
|
|
23
31
|
export type { EditorJustifyContentMessages, EditorJustifyContentValue, } from './components/editor/molecules/EditorJustifyContent/EditorJustifyContent.vue';
|
|
24
32
|
export { EDITOR_MAX_WIDTH_STEPS } from './components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue';
|
|
25
33
|
export type { EditorMaxWidthMessages, EditorMaxWidthValue, } from './components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue';
|
|
@@ -27,7 +35,8 @@ export { EDITOR_LINE_HEIGHT_STEPS } from './components/editor/molecules/EditorLi
|
|
|
27
35
|
export type { EditorLineHeightMessages, EditorLineHeightValue, } from './components/editor/molecules/EditorLineHeight/EditorLineHeight.vue';
|
|
28
36
|
export { EDITOR_LETTER_SPACING_STEPS } from './components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.vue';
|
|
29
37
|
export type { EditorLetterSpacingMessages, EditorLetterSpacingValue, } from './components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.vue';
|
|
30
|
-
export
|
|
38
|
+
export { EDITOR_PADDING_STEPS } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
|
|
39
|
+
export type { EditorPaddingMessages, EditorPaddingStep, } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
|
|
31
40
|
export type { NexxtTemplateCardContentFeature, NexxtTemplateCardProps, NexxtTemplateCardSlots, } from './components/molecules/TemplateCard/TemplateCard.vue';
|
|
32
41
|
export { default as NexxtAnimatedNumber } from './components/atoms/AnimatedNumber/AnimatedNumber.vue';
|
|
33
42
|
export { default as NexxtAnnouncement } from './components/molecules/Announcement/Announcement.vue';
|