@nexxtmove/ui 1.42.0 → 1.44.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/atoms/EditorDimensionField/EditorDimensionField.vue.d.ts +89 -0
- package/dist/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue.d.ts +6 -0
- package/dist/components/editor/molecules/EditorSize/EditorSize.vue.d.ts +101 -0
- package/dist/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.vue.d.ts +38 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1203 -919
- package/dist/nuxt.js +3 -0
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.vue +472 -0
- package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.vue +6 -0
- package/src/components/editor/molecules/EditorSize/EditorSize.vue +257 -0
- package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.vue +69 -0
- package/src/components.json +3 -0
- package/src/index.ts +16 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** A unit a dimension can be written in. */
|
|
2
|
+
export type EditorDimensionUnit = 'px' | '%';
|
|
3
|
+
/** A dimension as the field edits it: a whole number and the unit it is in. */
|
|
4
|
+
export interface EditorDimensionValue {
|
|
5
|
+
value: number;
|
|
6
|
+
unit: EditorDimensionUnit;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The range a value is clamped to per unit, unless the `min` / `max` props say
|
|
10
|
+
* otherwise. The px range starts at 40 rather than 0: below that an element
|
|
11
|
+
* set to a fixed size is too small to select on the canvas again.
|
|
12
|
+
*/
|
|
13
|
+
export declare const EDITOR_DIMENSION_LIMITS: {
|
|
14
|
+
readonly px: {
|
|
15
|
+
readonly min: 40;
|
|
16
|
+
readonly max: 1600;
|
|
17
|
+
};
|
|
18
|
+
readonly '%': {
|
|
19
|
+
readonly min: 1;
|
|
20
|
+
readonly max: 100;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/** Overridable copy of the field. Every key is optional. */
|
|
24
|
+
export interface EditorDimensionFieldMessages {
|
|
25
|
+
/** Shown in an empty `optional` field, where empty means none. Defaults to `'Geen'`. */
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/** Accessible name of the unit selector, when more than one unit is offered. Defaults to `'Eenheid'`. */
|
|
28
|
+
unit?: string;
|
|
29
|
+
/** How the px unit is written. Defaults to `'px'`. */
|
|
30
|
+
px?: string;
|
|
31
|
+
/** How the percentage unit is written. Defaults to `'%'`. */
|
|
32
|
+
percent?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface NexxtEditorDimensionFieldProps {
|
|
35
|
+
/** Accessible name of the input; the unit is appended to it. Not rendered visibly. */
|
|
36
|
+
label: string;
|
|
37
|
+
/**
|
|
38
|
+
* The units the user can pick from, in the order they are offered. With one
|
|
39
|
+
* unit it is shown as plain text, with more as a selector. Defaults to `['px']`.
|
|
40
|
+
*/
|
|
41
|
+
units?: EditorDimensionUnit[];
|
|
42
|
+
/** Lowest value per unit, merged over `EDITOR_DIMENSION_LIMITS`. */
|
|
43
|
+
min?: Partial<Record<EditorDimensionUnit, number>>;
|
|
44
|
+
/** Highest value per unit, merged over `EDITOR_DIMENSION_LIMITS`. */
|
|
45
|
+
max?: Partial<Record<EditorDimensionUnit, number>>;
|
|
46
|
+
/**
|
|
47
|
+
* An emptied field commits `null` -- none -- and shows the placeholder.
|
|
48
|
+
* Without it, emptying the field is a typo and the old value comes back.
|
|
49
|
+
*/
|
|
50
|
+
optional?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Copy of the placeholder and the units. Defaults are Dutch and are merged
|
|
53
|
+
* per key, so overriding one keeps the defaults of the others. Copy is never
|
|
54
|
+
* translated inside the component.
|
|
55
|
+
*/
|
|
56
|
+
messages?: EditorDimensionFieldMessages;
|
|
57
|
+
}
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
60
|
+
declare const __VLS_export: import('vue').DefineComponent<NexxtEditorDimensionFieldProps & {
|
|
61
|
+
/**
|
|
62
|
+
* The dimension, or `null` for none. A `null` from outside -- another element
|
|
63
|
+
* selected, an undo -- resets the unit to the first of `units`; a field the
|
|
64
|
+
* user emptied keeps the unit picked in it. A value from outside brings its
|
|
65
|
+
* own unit.
|
|
66
|
+
*/
|
|
67
|
+
modelValue?: EditorDimensionValue | null;
|
|
68
|
+
}, {
|
|
69
|
+
/**
|
|
70
|
+
* Moves focus into the input and selects its value, so typing replaces it.
|
|
71
|
+
* Pass `{ preventScroll: true }` while the field is still being revealed in a
|
|
72
|
+
* clipping box, which the browser would otherwise scroll to bring it in view.
|
|
73
|
+
*/
|
|
74
|
+
focus: (options?: FocusOptions) => void;
|
|
75
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
76
|
+
"update:modelValue": (value: EditorDimensionValue | null) => any;
|
|
77
|
+
commit: () => any;
|
|
78
|
+
}, string, import('vue').PublicProps, Readonly<NexxtEditorDimensionFieldProps & {
|
|
79
|
+
/**
|
|
80
|
+
* The dimension, or `null` for none. A `null` from outside -- another element
|
|
81
|
+
* selected, an undo -- resets the unit to the first of `units`; a field the
|
|
82
|
+
* user emptied keeps the unit picked in it. A value from outside brings its
|
|
83
|
+
* own unit.
|
|
84
|
+
*/
|
|
85
|
+
modelValue?: EditorDimensionValue | null;
|
|
86
|
+
}> & Readonly<{
|
|
87
|
+
"onUpdate:modelValue"?: ((value: EditorDimensionValue | null) => any) | undefined;
|
|
88
|
+
onCommit?: (() => any) | undefined;
|
|
89
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -54,6 +54,12 @@ export interface EditorMaxWidthMessages {
|
|
|
54
54
|
*/
|
|
55
55
|
unit?: string;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Sets a width on Tailwind's `max-w-*` steps, stored as the class.
|
|
59
|
+
*
|
|
60
|
+
* @deprecated Use `NexxtEditorSizeLimit`: a free maximum in px or % that can
|
|
61
|
+
* be none.
|
|
62
|
+
*/
|
|
57
63
|
export interface NexxtEditorMaxWidthProps {
|
|
58
64
|
/**
|
|
59
65
|
* Header text of the settings block. Defaults to the Dutch
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { EditorDimensionUnit, EditorDimensionValue } from '../../atoms/EditorDimensionField/EditorDimensionField.vue';
|
|
2
|
+
/**
|
|
3
|
+
* The options the editor offers, in the order they are shown. The labels are
|
|
4
|
+
* not in here; they arrive through `messages`, keyed by token.
|
|
5
|
+
*/
|
|
6
|
+
export declare const EDITOR_SIZE_OPTIONS: readonly [{
|
|
7
|
+
readonly token: "auto";
|
|
8
|
+
}, {
|
|
9
|
+
readonly token: "fill";
|
|
10
|
+
}, {
|
|
11
|
+
readonly token: "fixed";
|
|
12
|
+
}];
|
|
13
|
+
/** How a dimension is sized: by its content, filling its parent, or fixed. */
|
|
14
|
+
export type EditorSizeMode = (typeof EDITOR_SIZE_OPTIONS)[number]['token'];
|
|
15
|
+
export interface EditorSizeValue {
|
|
16
|
+
mode: EditorSizeMode;
|
|
17
|
+
/**
|
|
18
|
+
* The fixed dimension. Kept when another mode is picked, so switching back
|
|
19
|
+
* to `'fixed'` restores it; it only applies while `mode` is `'fixed'`. The
|
|
20
|
+
* app always fills it with the measured size of the element, so picking
|
|
21
|
+
* `'fixed'` starts from that size.
|
|
22
|
+
*/
|
|
23
|
+
fixed?: EditorDimensionValue;
|
|
24
|
+
}
|
|
25
|
+
/** Overridable copy of the options and the field. Every key is optional. */
|
|
26
|
+
export interface EditorSizeMessages {
|
|
27
|
+
/** Label of the `auto` option. Defaults to `'Automatisch'`. */
|
|
28
|
+
auto?: string;
|
|
29
|
+
/** Label of the `fill` option. Defaults to `'Vullen'`. */
|
|
30
|
+
fill?: string;
|
|
31
|
+
/** Label of the `fixed` option. Defaults to `'Vast'`. */
|
|
32
|
+
fixed?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Accessible name of the `auto` option. Defaults to the label followed by
|
|
35
|
+
* the option, lowercased: `'Breedte automatisch'`. Pass it for a language
|
|
36
|
+
* where that concatenation does not read.
|
|
37
|
+
*/
|
|
38
|
+
autoAriaLabel?: string;
|
|
39
|
+
/** Accessible name of the `fill` option. Defaults to `'Breedte vullen'`, built the same way. */
|
|
40
|
+
fillAriaLabel?: string;
|
|
41
|
+
/** Accessible name of the `fixed` option. Defaults to `'Breedte vast'`, built the same way. */
|
|
42
|
+
fixedAriaLabel?: string;
|
|
43
|
+
/** Accessible name of the unit selector, when more than one unit is offered. Defaults to `'Eenheid'`. */
|
|
44
|
+
unit?: string;
|
|
45
|
+
/** How the px unit is written. Defaults to `'px'`. */
|
|
46
|
+
px?: string;
|
|
47
|
+
/** How the percentage unit is written. Defaults to `'%'`. */
|
|
48
|
+
percent?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface NexxtEditorSizeProps {
|
|
51
|
+
/**
|
|
52
|
+
* Header text of the settings block, and the accessible name of the fixed
|
|
53
|
+
* field. Defaults to the Dutch `'Formaat'`; a consumer showing a width and a
|
|
54
|
+
* height passes `'Breedte'` and `'Hoogte'`.
|
|
55
|
+
*/
|
|
56
|
+
label?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The modes offered, as a subset of `'auto'`, `'fill'` and `'fixed'`; they
|
|
59
|
+
* are always shown in that order. An image, which has nothing to fill,
|
|
60
|
+
* passes `['auto', 'fixed']`. Defaults to all three. A model whose mode is
|
|
61
|
+
* not offered shows no option selected.
|
|
62
|
+
*/
|
|
63
|
+
modes?: EditorSizeMode[];
|
|
64
|
+
/** The units the fixed field offers. Defaults to `['px']`. */
|
|
65
|
+
units?: EditorDimensionUnit[];
|
|
66
|
+
/** Lowest fixed value per unit, merged over `EDITOR_DIMENSION_LIMITS`. */
|
|
67
|
+
min?: Partial<Record<EditorDimensionUnit, number>>;
|
|
68
|
+
/** Highest fixed value per unit, merged over `EDITOR_DIMENSION_LIMITS`. */
|
|
69
|
+
max?: Partial<Record<EditorDimensionUnit, number>>;
|
|
70
|
+
/**
|
|
71
|
+
* Copy of the options and the field. Defaults are Dutch and are merged per
|
|
72
|
+
* key, so overriding one keeps the defaults of the others. Copy is never
|
|
73
|
+
* translated inside the component.
|
|
74
|
+
*/
|
|
75
|
+
messages?: EditorSizeMessages;
|
|
76
|
+
}
|
|
77
|
+
declare const _default: typeof __VLS_export;
|
|
78
|
+
export default _default;
|
|
79
|
+
declare const __VLS_export: import('vue').DefineComponent<NexxtEditorSizeProps & {
|
|
80
|
+
/**
|
|
81
|
+
* The size. Fill `fixed` with the measured size of the element, as the app
|
|
82
|
+
* always does. Without it, picking `'fixed'` writes `{ mode: 'fixed' }` and
|
|
83
|
+
* commits straight away, leaving a fixed mode without a size until a value is
|
|
84
|
+
* typed; with the measured size, that state does not come up.
|
|
85
|
+
*/
|
|
86
|
+
modelValue: EditorSizeValue;
|
|
87
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
88
|
+
"update:modelValue": (value: EditorSizeValue) => any;
|
|
89
|
+
commit: () => any;
|
|
90
|
+
}, string, import('vue').PublicProps, Readonly<NexxtEditorSizeProps & {
|
|
91
|
+
/**
|
|
92
|
+
* The size. Fill `fixed` with the measured size of the element, as the app
|
|
93
|
+
* always does. Without it, picking `'fixed'` writes `{ mode: 'fixed' }` and
|
|
94
|
+
* commits straight away, leaving a fixed mode without a size until a value is
|
|
95
|
+
* typed; with the measured size, that state does not come up.
|
|
96
|
+
*/
|
|
97
|
+
modelValue: EditorSizeValue;
|
|
98
|
+
}> & Readonly<{
|
|
99
|
+
"onUpdate:modelValue"?: ((value: EditorSizeValue) => any) | undefined;
|
|
100
|
+
onCommit?: (() => any) | undefined;
|
|
101
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EditorDimensionValue, EditorDimensionFieldMessages, EditorDimensionUnit } from '../../atoms/EditorDimensionField/EditorDimensionField.vue';
|
|
2
|
+
/** Overridable copy of the field. Every key is optional. */
|
|
3
|
+
export type EditorSizeLimitMessages = EditorDimensionFieldMessages;
|
|
4
|
+
/**
|
|
5
|
+
* A free minimum or maximum of an element's size, in px or %, that can be
|
|
6
|
+
* none. Replaces the deprecated `NexxtEditorMaxWidth`, which offers only
|
|
7
|
+
* Tailwind's `max-w-*` steps.
|
|
8
|
+
*/
|
|
9
|
+
export interface NexxtEditorSizeLimitProps {
|
|
10
|
+
/** Visible label above the field, and its accessible name, as in `'Maximale breedte'`. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** The units the field offers. Defaults to `['px']`. */
|
|
13
|
+
units?: EditorDimensionUnit[];
|
|
14
|
+
/** Lowest value per unit, merged over `EDITOR_DIMENSION_LIMITS`. */
|
|
15
|
+
min?: Partial<Record<EditorDimensionUnit, number>>;
|
|
16
|
+
/** Highest value per unit, merged over `EDITOR_DIMENSION_LIMITS`. */
|
|
17
|
+
max?: Partial<Record<EditorDimensionUnit, number>>;
|
|
18
|
+
/**
|
|
19
|
+
* Copy of the placeholder and the units. Defaults are Dutch and are merged
|
|
20
|
+
* per key. Copy is never translated inside the component.
|
|
21
|
+
*/
|
|
22
|
+
messages?: EditorSizeLimitMessages;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
declare const __VLS_export: import('vue').DefineComponent<NexxtEditorSizeLimitProps & {
|
|
27
|
+
/** The limit, or `null` for none: emptying the field removes it. */
|
|
28
|
+
modelValue?: EditorDimensionValue | null;
|
|
29
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: EditorDimensionValue | null) => any;
|
|
31
|
+
commit: () => any;
|
|
32
|
+
}, string, import('vue').PublicProps, Readonly<NexxtEditorSizeLimitProps & {
|
|
33
|
+
/** The limit, or `null` for none: emptying the field removes it. */
|
|
34
|
+
modelValue?: EditorDimensionValue | null;
|
|
35
|
+
}> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((value: EditorDimensionValue | null) => any) | undefined;
|
|
37
|
+
onCommit?: (() => any) | undefined;
|
|
38
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,11 @@ export type { EditorFontSizeMessages, EditorFontSizeValue, NexxtEditorFontSizePr
|
|
|
41
41
|
export type { NexxtFontPickerFont, NexxtFontPickerInherit, NexxtFontPickerMessages, NexxtFontPickerProps, } from './components/organisms/FontPicker/FontPicker.vue';
|
|
42
42
|
export { EDITOR_PADDING_STEPS } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
|
|
43
43
|
export type { EditorPaddingMessages, EditorPaddingStep, } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
|
|
44
|
+
export { EDITOR_DIMENSION_LIMITS } from './components/editor/atoms/EditorDimensionField/EditorDimensionField.vue';
|
|
45
|
+
export type { EditorDimensionFieldMessages, EditorDimensionUnit, EditorDimensionValue, } from './components/editor/atoms/EditorDimensionField/EditorDimensionField.vue';
|
|
46
|
+
export { EDITOR_SIZE_OPTIONS } from './components/editor/molecules/EditorSize/EditorSize.vue';
|
|
47
|
+
export type { EditorSizeMessages, EditorSizeMode, EditorSizeValue, } from './components/editor/molecules/EditorSize/EditorSize.vue';
|
|
48
|
+
export type { EditorSizeLimitMessages } from './components/editor/molecules/EditorSizeLimit/EditorSizeLimit.vue';
|
|
44
49
|
export type { NexxtTemplateCardContentFeature, NexxtTemplateCardProps, NexxtTemplateCardSlots, } from './components/molecules/TemplateCard/TemplateCard.vue';
|
|
45
50
|
export { default as NexxtAnimatedNumber } from './components/atoms/AnimatedNumber/AnimatedNumber.vue';
|
|
46
51
|
export { default as NexxtAnnouncement } from './components/molecules/Announcement/Announcement.vue';
|
|
@@ -63,6 +68,7 @@ export { default as NexxtEditorAlignItems } from './components/editor/molecules/
|
|
|
63
68
|
export { default as NexxtEditorBackgroundSize } from './components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.vue';
|
|
64
69
|
export { default as NexxtEditorBorder } from './components/editor/molecules/EditorBorder/EditorBorder.vue';
|
|
65
70
|
export { default as NexxtEditorColor } from './components/editor/molecules/EditorColor/EditorColor.vue';
|
|
71
|
+
export { default as NexxtEditorDimensionField } from './components/editor/atoms/EditorDimensionField/EditorDimensionField.vue';
|
|
66
72
|
export { default as NexxtEditorFlexDirection } from './components/editor/molecules/EditorFlexDirection/EditorFlexDirection.vue';
|
|
67
73
|
export { default as NexxtEditorFontSize } from './components/editor/molecules/EditorFontSize/EditorFontSize.vue';
|
|
68
74
|
export { default as NexxtEditorGap } from './components/editor/molecules/EditorGap/EditorGap.vue';
|
|
@@ -74,6 +80,8 @@ export { default as NexxtEditorMaxWidth } from './components/editor/molecules/Ed
|
|
|
74
80
|
export { default as NexxtEditorPadding } from './components/editor/molecules/EditorPadding/EditorPadding.vue';
|
|
75
81
|
export { default as NexxtEditorRadius } from './components/editor/molecules/EditorRadius/EditorRadius.vue';
|
|
76
82
|
export { default as NexxtEditorSettingsBlock } from './components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.vue';
|
|
83
|
+
export { default as NexxtEditorSize } from './components/editor/molecules/EditorSize/EditorSize.vue';
|
|
84
|
+
export { default as NexxtEditorSizeLimit } from './components/editor/molecules/EditorSizeLimit/EditorSizeLimit.vue';
|
|
77
85
|
export { default as NexxtEditorTextAlign } from './components/editor/molecules/EditorTextAlign/EditorTextAlign.vue';
|
|
78
86
|
export { default as NexxtEnergyLabel } from './components/atoms/EnergyLabel/EnergyLabel.vue';
|
|
79
87
|
export { default as NexxtFloatingPanel } from './components/atoms/FloatingPanel/FloatingPanel.vue';
|