@kubex/zinc 1.1.102 → 1.1.103
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/custom-elements.json +2 -2
- package/dist/web-types.json +1 -1
- package/dist/zn.d.ts +4 -2
- package/dist/zn.min.css +1 -1
- package/dist/zn.min.js +394 -395
- package/docs/pages/components/remarkd-editor.md +1 -1
- package/package.json +1 -1
- package/scss/_root.scss +121 -8
- package/scss/shared/_base.scss +10 -4
- package/scss/shared/_button-mixin.scss +29 -0
- package/scss/shared/_button.scss +3 -33
- package/scss/themes/_aura.scss +87 -8
- package/scss/themes/_dark.scss +14 -2
- package/scss/themes/_light.scss +4 -3
- package/scss/themes/_modes.scss +32 -0
- package/src/components/animated-button/animated-button.component.ts +2 -1
- package/src/components/animated-button/animated-button.scss +1 -1
- package/src/components/bulk-actions/bulk-actions.component.ts +2 -1
- package/src/components/bulk-actions/bulk-actions.scss +0 -1
- package/src/components/button/button.component.ts +6 -1
- package/src/components/button/button.scss +1 -1
- package/src/components/chart/chart.component.ts +4 -0
- package/src/components/checkbox/checkbox.component.ts +3 -1
- package/src/components/checkbox/checkbox.scss +0 -2
- package/src/components/checkbox-group/checkbox-group.component.ts +2 -1
- package/src/components/checkbox-group/checkbox-group.scss +0 -1
- package/src/components/data-table/data-table.component.ts +3 -1
- package/src/components/data-table/data-table.scss +0 -1
- package/src/components/datepicker/datepicker.component.ts +2 -1
- package/src/components/datepicker/datepicker.scss +0 -1
- package/src/components/editor/modules/toolbar/toolbar.component.ts +3 -1
- package/src/components/editor/modules/toolbar/toolbar.scss +0 -1
- package/src/components/file/file.component.ts +2 -1
- package/src/components/file/file.scss +0 -1
- package/src/components/form-group/form-group.component.ts +2 -1
- package/src/components/form-group/form-group.scss +0 -1
- package/src/components/icon-picker/icon-picker.component.ts +8 -3
- package/src/components/icon-picker/icon-picker.scss +0 -1
- package/src/components/inline-edit/inline-edit.component.ts +2 -1
- package/src/components/inline-edit/inline-edit.scss +0 -1
- package/src/components/input/input.component.ts +2 -1
- package/src/components/input/input.scss +0 -1
- package/src/components/input-group/input-group.component.ts +2 -1
- package/src/components/input-group/input-group.scss +0 -1
- package/src/components/menu/menu.scss +6 -1
- package/src/components/page/page.scss +19 -5
- package/src/components/priority-list/priority-list.component.ts +2 -1
- package/src/components/priority-list/priority-list.scss +0 -1
- package/src/components/query-builder/query-builder.component.ts +2 -1
- package/src/components/query-builder/query-builder.scss +0 -1
- package/src/components/radio/radio.component.ts +3 -1
- package/src/components/radio/radio.scss +0 -2
- package/src/components/radio-group/radio-group.component.ts +2 -1
- package/src/components/radio-group/radio-group.scss +0 -1
- package/src/components/rating/rating.component.ts +2 -1
- package/src/components/rating/rating.scss +0 -1
- package/src/components/remarkd-editor/actions.ts +0 -4
- package/src/components/remarkd-editor/remarkd-editor.test.ts +5 -3
- package/src/components/schedule-builder/schedule-builder.component.ts +2 -1
- package/src/components/schedule-builder/schedule-builder.scss +0 -1
- package/src/components/select/select.component.ts +2 -1
- package/src/components/select/select.scss +0 -1
- package/src/components/tabs/tabs.component.ts +3 -1
- package/src/components/tabs/tabs.scss +0 -1
- package/src/components/textarea/textarea.component.ts +2 -1
- package/src/components/textarea/textarea.scss +0 -1
- package/src/components/tile/tile.component.ts +33 -20
- package/src/components/tile/tile.scss +2 -0
- package/src/components/tile/tile.test.ts +64 -3
- package/src/components/toggle/toggle.component.ts +2 -1
- package/src/components/toggle/toggle.scss +0 -1
- package/src/components/translations/translations.component.ts +2 -1
- package/src/components/translations/translations.scss +0 -1
- package/src/internal/theme.ts +37 -12
- package/src/internal/zinc-element.ts +7 -5
|
@@ -14,6 +14,7 @@ import ZnTooltip from "../tooltip";
|
|
|
14
14
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
15
15
|
|
|
16
16
|
import airDatepickerStyles from '../../../scss/air-datapicker.scss';
|
|
17
|
+
import formControlStyles from '../../form-control.scss';
|
|
17
18
|
import styles from './datepicker.scss';
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -54,7 +55,7 @@ import styles from './datepicker.scss';
|
|
|
54
55
|
* @cssproperty --zn-input-* - Inherited input component CSS custom properties.
|
|
55
56
|
*/
|
|
56
57
|
export default class ZnDatepicker extends ZincElement implements ZincFormControl {
|
|
57
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
58
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
58
59
|
|
|
59
60
|
static dependencies = {
|
|
60
61
|
'zn-icon': ZnIcon,
|
|
@@ -9,10 +9,12 @@ import ZnMenu from "../../../menu";
|
|
|
9
9
|
import ZnMenuItem from "../../../menu-item";
|
|
10
10
|
import type {EditorFeatureConfig} from "../../editor.component";
|
|
11
11
|
|
|
12
|
+
// Air Picker only positions correctly with the global sheet present inside this shadow root.
|
|
13
|
+
import bootStyles from '../../../../../scss/boot.scss';
|
|
12
14
|
import styles from './toolbar.scss';
|
|
13
15
|
|
|
14
16
|
export default class ToolbarComponent extends ZincElement {
|
|
15
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
17
|
+
static styles: CSSResultGroup = [unsafeCSS(bootStyles), unsafeCSS(styles)];
|
|
16
18
|
|
|
17
19
|
@property({type: Number})
|
|
18
20
|
public containerWidth: number;
|
|
@@ -14,6 +14,7 @@ import ZincElement, {type ZincFormControl} from '../../internal/zinc-element';
|
|
|
14
14
|
import ZnDialog from "../dialog";
|
|
15
15
|
import type ZnButton from "../button";
|
|
16
16
|
|
|
17
|
+
import formControlStyles from '../../form-control.scss';
|
|
17
18
|
import styles from './file.scss';
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -69,7 +70,7 @@ import styles from './file.scss';
|
|
|
69
70
|
* when a file is dropped
|
|
70
71
|
*/
|
|
71
72
|
export default class ZnFile extends ZincElement implements ZincFormControl {
|
|
72
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
73
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
73
74
|
static dependencies = {
|
|
74
75
|
'zn-dialog': ZnDialog
|
|
75
76
|
};
|
|
@@ -4,6 +4,7 @@ import { HasSlotController } from "../../internal/slot";
|
|
|
4
4
|
import { property } from 'lit/decorators.js';
|
|
5
5
|
import ZincElement from '../../internal/zinc-element';
|
|
6
6
|
|
|
7
|
+
import formControlStyles from '../../form-control.scss';
|
|
7
8
|
import styles from './form-group.scss';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -17,7 +18,7 @@ import styles from './form-group.scss';
|
|
|
17
18
|
*
|
|
18
19
|
*/
|
|
19
20
|
export default class ZnFormGroup extends ZincElement {
|
|
20
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
21
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
21
22
|
|
|
22
23
|
private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label', 'chip');
|
|
23
24
|
|
|
@@ -12,10 +12,11 @@ import ZnOption from '../option';
|
|
|
12
12
|
import ZnSelect from '../select';
|
|
13
13
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
14
14
|
|
|
15
|
+
import formControlStyles from '../../form-control.scss';
|
|
15
16
|
import styles from './icon-picker.scss';
|
|
16
17
|
|
|
17
18
|
export default class ZnIconPicker extends ZincElement implements ZincFormControl {
|
|
18
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
19
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
19
20
|
static dependencies = {
|
|
20
21
|
'zn-icon': ZnIcon,
|
|
21
22
|
'zn-button': ZnButton,
|
|
@@ -29,7 +30,11 @@ export default class ZnIconPicker extends ZincElement implements ZincFormControl
|
|
|
29
30
|
assumeInteractionOn: ['zn-change'],
|
|
30
31
|
// With allow-upload, a chosen file is submitted under `name` in place of
|
|
31
32
|
// the icon string — the two are mutually exclusive.
|
|
32
|
-
value: (el: ZnIconPicker) => el._file ?? el.icon
|
|
33
|
+
value: (el: ZnIconPicker) => el._file ?? el.icon,
|
|
34
|
+
setValue: (el: ZnIconPicker, value: string) => {
|
|
35
|
+
el.clearFile();
|
|
36
|
+
el.icon = value ?? '';
|
|
37
|
+
}
|
|
33
38
|
});
|
|
34
39
|
|
|
35
40
|
@property() name = '';
|
|
@@ -49,7 +54,7 @@ export default class ZnIconPicker extends ZincElement implements ZincFormControl
|
|
|
49
54
|
@property() accept = 'image/*';
|
|
50
55
|
@property({reflect: true}) form: string;
|
|
51
56
|
|
|
52
|
-
@defaultValue() defaultValue = '';
|
|
57
|
+
@defaultValue('icon') defaultValue = '';
|
|
53
58
|
|
|
54
59
|
@state() private _dialogOpen = false;
|
|
55
60
|
@state() private _searchQuery = '';
|
|
@@ -13,6 +13,7 @@ import ZnSelect from "../select";
|
|
|
13
13
|
import type { ZincFormControl } from '../../internal/zinc-element';
|
|
14
14
|
import type ZnInput from "../input";
|
|
15
15
|
|
|
16
|
+
import formElementStyles from '../../../scss/shared/_form-elements.scss';
|
|
16
17
|
import styles from './inline-edit.scss';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -34,7 +35,7 @@ import styles from './inline-edit.scss';
|
|
|
34
35
|
* @cssproperty --example - An example CSS custom property.
|
|
35
36
|
*/
|
|
36
37
|
export default class ZnInlineEdit extends ZincElement implements ZincFormControl {
|
|
37
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
38
|
+
static styles: CSSResultGroup = [unsafeCSS(formElementStyles), unsafeCSS(styles)];
|
|
38
39
|
|
|
39
40
|
private readonly formControlController = new FormControlController(this, {
|
|
40
41
|
defaultValue: (control: ZnInlineEdit) => control.defaultValue,
|
|
@@ -17,6 +17,7 @@ import ZnSlashMenu from "../slash-menu";
|
|
|
17
17
|
import ZnTooltip from "../tooltip";
|
|
18
18
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
19
19
|
|
|
20
|
+
import formControlStyles from '../../form-control.scss';
|
|
20
21
|
import styles from './input.scss';
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -75,7 +76,7 @@ import styles from './input.scss';
|
|
|
75
76
|
* @cssproperty --zn-range-thumb-ring-width - The width of the ring drawn around a range input's thumb.
|
|
76
77
|
*/
|
|
77
78
|
export default class ZnInput extends ZincElement implements ZincFormControl {
|
|
78
|
-
static styles = unsafeCSS(styles);
|
|
79
|
+
static styles = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
79
80
|
static dependencies = {
|
|
80
81
|
'zn-icon': ZnIcon,
|
|
81
82
|
'zn-slash-item': ZnSlashItem,
|
|
@@ -4,6 +4,7 @@ import {HasSlotController} from '../../internal/slot';
|
|
|
4
4
|
import {property, query} from 'lit/decorators.js';
|
|
5
5
|
import ZincElement from '../../internal/zinc-element';
|
|
6
6
|
|
|
7
|
+
import formControlStyles from '../../form-control.scss';
|
|
7
8
|
import styles from './input-group.scss';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -21,7 +22,7 @@ import styles from './input-group.scss';
|
|
|
21
22
|
* @csspart form-control-input - The input group container.
|
|
22
23
|
*/
|
|
23
24
|
export default class ZnInputGroup extends ZincElement {
|
|
24
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
25
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
25
26
|
|
|
26
27
|
private readonly hasSlotController = new HasSlotController(this, 'label');
|
|
27
28
|
|
|
@@ -14,7 +14,12 @@
|
|
|
14
14
|
overflow: auto;
|
|
15
15
|
overscroll-behavior: none;
|
|
16
16
|
box-shadow: 0 4px 8px -4px rgba(33, 33, 33, 0.1);
|
|
17
|
-
|
|
17
|
+
// Same surface as the shell-header menus below, so every dropdown in the
|
|
18
|
+
// product reads as one material rather than splitting into --zn-panel menus
|
|
19
|
+
// and --zn-color-navigation ones depending on where it was mounted.
|
|
20
|
+
// (No backdrop-filter here: at 0.95 the blur is not worth the GPU cost on
|
|
21
|
+
// every dropdown, and .menu--shell keeps it for the chrome look.)
|
|
22
|
+
background-color: rgba(var(--zn-color-navigation, 255, 255, 255), 0.95);
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
// Dropdown vs shell hover/row styling lives on zn-menu-item, keyed by the
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
// A theme sets it to an image and its tile size; unset it costs nothing.
|
|
13
13
|
--zn-page-texture: none;
|
|
14
14
|
--zn-page-texture-size: auto;
|
|
15
|
-
|
|
15
|
+
// The page canvas. Defaults to the body so the page is flush with the shell,
|
|
16
|
+
// but a theme can lift it clear by setting --zn-page-canvas on its root (it
|
|
17
|
+
// inherits across this shadow boundary). The indirection is needed because
|
|
18
|
+
// this :host declaration would otherwise beat any inherited value.
|
|
19
|
+
--zn-page-content-background: var(--zn-page-canvas, var(--zn-body));
|
|
16
20
|
--zn-page-header-background: var(--zn-page-surface-background, var(--zn-page-background, var(--zn-body)));
|
|
17
21
|
// A modal shell overlays its own close button at --zn-base-gap from the page edge;
|
|
18
22
|
// these describe it so the header can keep clear of it.
|
|
@@ -62,11 +66,19 @@
|
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
// Aura theme — the page header carries
|
|
66
|
-
//
|
|
69
|
+
// Aura theme — the page header carries an aurora gradient instead of the flat
|
|
70
|
+
// body-coloured surface. The gradient itself is a token so each mode can own its
|
|
71
|
+
// own (pale violet/teal in light, deep violet/blue in dark) without a second
|
|
72
|
+
// selector here; it is set on the theme root in zinc's scss/_root.scss and
|
|
73
|
+
// inherits across this shadow boundary. Deliberately NOT called
|
|
74
|
+
// --zn-page-header-background: that name is already taken above, by an RGB
|
|
75
|
+
// triplet read as rgba(var(--zn-page-header-background), 95%).
|
|
76
|
+
//
|
|
77
|
+
// The var() fallback is the light gradient, so a consumer on a stale zn.min.css
|
|
78
|
+
// (no token) still gets the original aura header rather than a bare surface.
|
|
67
79
|
:host-context([t="aura"]) .page__header,
|
|
68
80
|
:host-context(.theme-aura) .page__header {
|
|
69
|
-
background: linear-gradient(225deg, rgba(233, 227, 255, 1) 0%, rgba(214, 246, 245, 1) 40%, rgba(233, 227, 255, 1) 100%), linear-gradient(180deg, rgba(129, 153, 217, 0) 0%, rgba(0, 0, 0, 1) 100%);
|
|
81
|
+
background: var(--zn-page-header-aurora, linear-gradient(225deg, rgba(233, 227, 255, 1) 0%, rgba(214, 246, 245, 1) 40%, rgba(233, 227, 255, 1) 100%), linear-gradient(180deg, rgba(129, 153, 217, 0) 0%, rgba(0, 0, 0, 1) 100%));
|
|
70
82
|
|
|
71
83
|
|
|
72
84
|
// Held still deliberately. This gradient used to drift via
|
|
@@ -111,7 +123,9 @@
|
|
|
111
123
|
// aurora wave (it no longer darkens what it sits on); restore the blend mode
|
|
112
124
|
// if the look regresses, but expect the GPU cost back with it.
|
|
113
125
|
//mix-blend-mode: color-burn;
|
|
114
|
-
|
|
126
|
+
// The wave artwork is a mid violet (#8b7fd4): on the pale light gradient it
|
|
127
|
+
// darkens, on the deep dark one it lifts, so each mode needs its own weight.
|
|
128
|
+
opacity: var(--zn-page-header-wave-opacity, 0.04);
|
|
115
129
|
pointer-events: none;
|
|
116
130
|
}
|
|
117
131
|
|
|
@@ -11,6 +11,7 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
11
11
|
import ZnIcon from '../icon';
|
|
12
12
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
13
13
|
|
|
14
|
+
import formControlStyles from '../../form-control.scss';
|
|
14
15
|
import styles from './priority-list.scss';
|
|
15
16
|
|
|
16
17
|
export interface PriorityItem {
|
|
@@ -60,7 +61,7 @@ export default class ZnPriorityList extends ZincElement implements ZincFormContr
|
|
|
60
61
|
'zn-icon': ZnIcon,
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
64
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
64
65
|
|
|
65
66
|
protected readonly formControlController = new FormControlController(this, {
|
|
66
67
|
value: (control: ZnPriorityList) => {
|
|
@@ -12,6 +12,7 @@ import type {ZincFormControl} from '../../internal/zinc-element';
|
|
|
12
12
|
import type {ZnChangeEvent} from "../../events/zn-change";
|
|
13
13
|
import type {ZnInputEvent} from "../../events/zn-input";
|
|
14
14
|
|
|
15
|
+
import formElementStyles from '../../../scss/shared/_form-elements.scss';
|
|
15
16
|
import styles from './query-builder.scss';
|
|
16
17
|
import type ZnDatepicker from "../datepicker";
|
|
17
18
|
|
|
@@ -138,7 +139,7 @@ export interface CreatedRule {
|
|
|
138
139
|
* @cssproperty --example - An example CSS custom property.
|
|
139
140
|
*/
|
|
140
141
|
export default class ZnQueryBuilder extends ZincElement implements ZincFormControl {
|
|
141
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
142
|
+
static styles: CSSResultGroup = [unsafeCSS(formElementStyles), unsafeCSS(styles)];
|
|
142
143
|
static dependencies = {
|
|
143
144
|
'zn-button': ZnButton,
|
|
144
145
|
'zn-input': ZnInput,
|
|
@@ -12,6 +12,8 @@ import ZnIcon from "../icon";
|
|
|
12
12
|
import type {SelectionCardControlPosition, SelectionCardImagePosition} from '../../internal/selection-card';
|
|
13
13
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
14
14
|
|
|
15
|
+
import formControlStyles from '../../form-control.scss';
|
|
16
|
+
import selectionCardStyles from '../../selection-card.scss';
|
|
15
17
|
import styles from './radio.scss';
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -55,7 +57,7 @@ import styles from './radio.scss';
|
|
|
55
57
|
* @cssproperty --zn-selection-card-border-radius - Corner radius of a contained container.
|
|
56
58
|
*/
|
|
57
59
|
export default class ZnRadio extends ZincElement implements ZincFormControl {
|
|
58
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
60
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(selectionCardStyles), unsafeCSS(styles)];
|
|
59
61
|
static dependencies = {'zn-icon': ZnIcon};
|
|
60
62
|
|
|
61
63
|
private readonly formControlController = new FormControlController(this, {
|
|
@@ -13,6 +13,7 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
13
13
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
14
14
|
import type ZnRadio from "../radio";
|
|
15
15
|
|
|
16
|
+
import formControlStyles from '../../form-control.scss';
|
|
16
17
|
import styles from './radio-group.scss';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -33,7 +34,7 @@ import styles from './radio-group.scss';
|
|
|
33
34
|
* @cssproperty --zn-radio-group-column-width - Minimum column width used by the horizontal contained grid, or the card basis when `wrap` is set.
|
|
34
35
|
*/
|
|
35
36
|
export default class ZnRadioGroup extends ZincElement implements ZincFormControl {
|
|
36
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
37
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
37
38
|
|
|
38
39
|
protected readonly formControlController = new FormControlController(this);
|
|
39
40
|
private readonly hasSlotController = new HasSlotController(this, 'help-text', 'label');
|
|
@@ -9,6 +9,7 @@ import ZincElement from '../../internal/zinc-element';
|
|
|
9
9
|
|
|
10
10
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
11
11
|
|
|
12
|
+
import formControlStyles from '../../form-control.scss';
|
|
12
13
|
import styles from './rating.scss';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -35,7 +36,7 @@ import styles from './rating.scss';
|
|
|
35
36
|
* @cssproperty --preview-size - The font size of the preview value.
|
|
36
37
|
*/
|
|
37
38
|
export default class ZnRating extends ZincElement implements ZincFormControl {
|
|
38
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
39
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
39
40
|
|
|
40
41
|
private readonly formControlController = new FormControlController(this, {
|
|
41
42
|
assumeInteractionOn: ['zn-blur', 'zn-input']
|
|
@@ -79,7 +79,6 @@ export const EDITOR_ACTIONS: EditorAction[] = [
|
|
|
79
79
|
{key: 'literal-block', label: 'Literal', icon: 'file-code@lu', group: 'blocks', prefix: '....\n\n....', caretOffset: 5},
|
|
80
80
|
{key: 'listing-block', label: 'Listing', icon: 'terminal@lu', group: 'blocks', prefix: '----\n\n----', caretOffset: 5},
|
|
81
81
|
{key: 'generic-container', label: 'Container', icon: 'box@lu', group: 'blocks', prefix: '!!!!\n\n!!!!', caretOffset: 5},
|
|
82
|
-
{key: 'comments', label: 'Comment', icon: 'message-square-dashed@lu', group: 'blocks', prefix: '////\n\n////', caretOffset: 5},
|
|
83
82
|
{key: 'hardbreaks', label: 'Hard breaks', icon: 'wrap-text@lu', group: 'blocks', prefix: '[%hardbreaks]\n', keywords: ['line breaks']},
|
|
84
83
|
|
|
85
84
|
// Structured
|
|
@@ -89,7 +88,6 @@ export const EDITOR_ACTIONS: EditorAction[] = [
|
|
|
89
88
|
|
|
90
89
|
// Media
|
|
91
90
|
{key: 'asciidoc-image', label: 'Image', icon: 'image@lu', group: 'media', opens: 'image'},
|
|
92
|
-
{key: 'image-alignment', label: 'Aligned image', icon: 'image-plus@lu', group: 'media', prefix: '[.align-center]\nimage::file.png[Alt,640,480]', caretOffset: 23},
|
|
93
91
|
{key: 'video', label: 'Video', icon: 'video@lu', group: 'media', prefix: '{{video:ID source=youtube}}', caretOffset: 8},
|
|
94
92
|
{key: 'include', label: 'Include', icon: 'blocks@lu', group: 'media', opens: 'include'},
|
|
95
93
|
// The path placeholder is load-bearing: `t::partial::` with an empty path makes parse() throw.
|
|
@@ -99,7 +97,6 @@ export const EDITOR_ACTIONS: EditorAction[] = [
|
|
|
99
97
|
// Objects
|
|
100
98
|
{key: 'button-object', label: 'Button', icon: 'mouse-pointer-click@lu', group: 'objects', prefix: '{{button:action text="Label" href=/}}', caretOffset: 9},
|
|
101
99
|
{key: 'object-macros', label: 'Link object', icon: 'external-link@lu', group: 'objects', prefix: '{{link:https:// text=Label}}', caretOffset: 7},
|
|
102
|
-
{key: 'anchor', label: 'Anchor', icon: 'anchor@lu', group: 'objects', prefix: '{{anchor name=top}}', caretOffset: 14},
|
|
103
100
|
{key: 'meter', label: 'Meter', icon: 'gauge@lu', group: 'objects', prefix: '{{meter id=progress min=0 max=10 value=5}}', caretOffset: 11},
|
|
104
101
|
{key: 'object-attributes', label: 'Break object', icon: 'separator-horizontal@lu', group: 'objects', prefix: '{{br}}'},
|
|
105
102
|
|
|
@@ -124,7 +121,6 @@ export const EDITOR_ACTIONS: EditorAction[] = [
|
|
|
124
121
|
{key: 'inline-code', label: 'Code', icon: 'square-code@lu', group: 'inline', inline: {before: '`', placeholder: 'code'}},
|
|
125
122
|
{key: 'underline', label: 'Underline', icon: 'underline@lu', group: 'inline', inline: {before: '___', placeholder: 'text'}},
|
|
126
123
|
{key: 'strike', label: 'Strikethrough', icon: 'strikethrough@lu', group: 'inline', keywords: ['delete'], inline: {before: '~~', placeholder: 'text'}},
|
|
127
|
-
{key: 'highlight', label: 'Highlight', icon: 'highlighter@lu', group: 'inline', keywords: ['mark'], inline: {before: '#', placeholder: 'text'}},
|
|
128
124
|
{key: 'subscript', label: 'Subscript', icon: 'subscript@lu', group: 'inline', inline: {before: '~', placeholder: '2'}},
|
|
129
125
|
{key: 'superscript', label: 'Superscript', icon: 'superscript@lu', group: 'inline', inline: {before: '^', placeholder: '2'}},
|
|
130
126
|
{key: 'keyboard', label: 'Keyboard', icon: 'keyboard@lu', group: 'inline', keywords: ['kbd', 'shortcut'], inline: {before: 'kbd:[', after: ']', placeholder: 'Ctrl+C'}},
|
|
@@ -24,11 +24,10 @@ describe('<zn-remarkd-editor>', () => {
|
|
|
24
24
|
// attributes-title → `.Intro` alone is empty; a title decorates the block below it
|
|
25
25
|
// reference-list → `{{reflist}}` is empty until something references it
|
|
26
26
|
// asciidoc-section → `== ` alone is empty; the section needs a body the author types
|
|
27
|
-
// comments → `////` blocks are meant to render nothing, that is the feature
|
|
28
27
|
// hardbreaks → `[%hardbreaks]` alone is an attribute line; it needs the paragraph
|
|
29
28
|
// below it (real fixture: attribute line directly followed by body,
|
|
30
29
|
// no blank line) that the helper's `\n\n` placeholder trick can't reach
|
|
31
|
-
const rendersEmpty = ['attributes-title', 'reference-list', 'asciidoc-section', '
|
|
30
|
+
const rendersEmpty = ['attributes-title', 'reference-list', 'asciidoc-section', 'hardbreaks'];
|
|
32
31
|
// Logic actions all render through the editor's own chrome (a variable chip or a
|
|
33
32
|
// conditional wrapper) rather than the parser — listed explicitly, not by group, so a
|
|
34
33
|
// future logic action with no chrome of its own falls through and fails this guard.
|
|
@@ -109,8 +108,11 @@ describe('<zn-remarkd-editor>', () => {
|
|
|
109
108
|
// not in the Go renderer the user's app ships in production, tested by the user directly.
|
|
110
109
|
// `id-block` is additionally broken in remarkd itself (its own fixture enshrines the leak).
|
|
111
110
|
const unsupportedByProductionRenderer = ['id-block', 'table', 'pros-cons', 'accordion'];
|
|
111
|
+
// Dropped by request: `image-alignment` duplicates the image block's own alignment control,
|
|
112
|
+
// and comments/highlight are not wanted in the authoring surface.
|
|
113
|
+
const withdrawn = ['image-alignment', 'comments', 'highlight'];
|
|
112
114
|
const covered = new Set(EDITOR_ACTIONS.map(a => a.key));
|
|
113
|
-
const excluded = [...notActions, ...unsupportedByProductionRenderer];
|
|
115
|
+
const excluded = [...notActions, ...unsupportedByProductionRenderer, ...withdrawn];
|
|
114
116
|
const missing = FEATURE_KEYS.filter(f => !excluded.includes(f) && !covered.has(f));
|
|
115
117
|
expect(missing, `features with no action: ${missing.join(', ')}`).to.be.empty;
|
|
116
118
|
});
|
|
@@ -14,6 +14,7 @@ import ZnOption from '../option';
|
|
|
14
14
|
import ZnSelect from '../select';
|
|
15
15
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
16
16
|
|
|
17
|
+
import formControlStyles from '../../form-control.scss';
|
|
17
18
|
import styles from './schedule-builder.scss';
|
|
18
19
|
|
|
19
20
|
/** The seven weekday keys used throughout the schedule. */
|
|
@@ -533,7 +534,7 @@ type SlotState = 'closed' | 'open' | 'reduced';
|
|
|
533
534
|
* @cssproperty --reduced-color - The fill used for hours an exception removes.
|
|
534
535
|
*/
|
|
535
536
|
export default class ZnScheduleBuilder extends ZincElement implements ZincFormControl {
|
|
536
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
537
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
537
538
|
|
|
538
539
|
static formAssociated = true;
|
|
539
540
|
|
|
@@ -21,6 +21,7 @@ import type {CSSResultGroup, PropertyValues, TemplateResult} from 'lit';
|
|
|
21
21
|
import type {ZincFormControl} from '../../internal/zinc-element';
|
|
22
22
|
import type {ZnRemoveEvent} from "../../events/zn-remove";
|
|
23
23
|
|
|
24
|
+
import formControlStyles from '../../form-control.scss';
|
|
24
25
|
import styles from './select.scss';
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -77,7 +78,7 @@ import styles from './select.scss';
|
|
|
77
78
|
* @csspart expand-icon - The container that wraps the expand icon.
|
|
78
79
|
*/
|
|
79
80
|
export default class ZnSelect extends ZincElement implements ZincFormControl {
|
|
80
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
81
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
81
82
|
static dependencies = {
|
|
82
83
|
'zn-icon': ZnIcon,
|
|
83
84
|
'zn-opt-group': ZnOptGroup,
|
|
@@ -17,6 +17,8 @@ import {property} from 'lit/decorators.js';
|
|
|
17
17
|
import {Store} from "../../internal/storage";
|
|
18
18
|
import ZincElement from '../../internal/zinc-element';
|
|
19
19
|
|
|
20
|
+
// Tabs load in such a way that the global sheet has to be re-applied inside the shadow root.
|
|
21
|
+
import bootStyles from '../../../scss/boot.scss';
|
|
20
22
|
import styles from './tabs.scss';
|
|
21
23
|
|
|
22
24
|
// Every element that manages its own tabs (ZnTabs and its subclasses). Tab
|
|
@@ -42,7 +44,7 @@ const tabContainerSelector = 'zn-tabs, zn-page, zn-page-nav';
|
|
|
42
44
|
* @cssproperty --example - An example CSS custom property.
|
|
43
45
|
*/
|
|
44
46
|
export default class ZnTabs extends ZincElement {
|
|
45
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
47
|
+
static styles: CSSResultGroup = [unsafeCSS(bootStyles), unsafeCSS(styles)];
|
|
46
48
|
@property({attribute: 'master-id', reflect: true}) masterId: string;
|
|
47
49
|
@property({attribute: 'default-uri', reflect: true}) defaultUri = '';
|
|
48
50
|
@property({attribute: 'active', reflect: true}) _current = '';
|
|
@@ -14,6 +14,7 @@ import ZincElement, {type ZincFormControl} from '../../internal/zinc-element';
|
|
|
14
14
|
import ZnSlashItem from "../slash-item";
|
|
15
15
|
import ZnSlashMenu from "../slash-menu";
|
|
16
16
|
|
|
17
|
+
import formControlStyles from '../../form-control.scss';
|
|
17
18
|
import styles from './textarea.scss';
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -52,7 +53,7 @@ import styles from './textarea.scss';
|
|
|
52
53
|
* @csspart slash-menu - The slash menu shown at the caret.
|
|
53
54
|
*/
|
|
54
55
|
export default class ZnTextarea extends ZincElement implements ZincFormControl {
|
|
55
|
-
static styles: CSSResultGroup = unsafeCSS(styles);
|
|
56
|
+
static styles: CSSResultGroup = [unsafeCSS(formControlStyles), unsafeCSS(styles)];
|
|
56
57
|
static dependencies = {
|
|
57
58
|
'zn-slash-item': ZnSlashItem,
|
|
58
59
|
'zn-slash-menu': ZnSlashMenu
|