@mdbase-dev/ui 0.1.0-beta.126 → 0.1.0-beta.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +168 -0
- package/css/collections.css +978 -0
- package/css/controls.css +33 -1
- package/css/screens.css +44 -2
- package/dist/AppSwitcher.js +187 -33
- package/dist/Checkbox.d.ts +14 -0
- package/dist/Checkbox.js +32 -0
- package/dist/CollectionModeControl.d.ts +11 -0
- package/dist/CollectionModeControl.js +290 -0
- package/dist/CommandPalette.d.ts +4 -2
- package/dist/CommandPalette.js +275 -103
- package/dist/Dialog.js +72 -25
- package/dist/Feedback.js +763 -229
- package/dist/FeedbackMarkup.d.ts +1 -1
- package/dist/FeedbackMarkup.js +326 -125
- package/dist/FeedbackVerification.js +115 -68
- package/dist/SaveNotice.js +71 -28
- package/dist/Select.js +183 -135
- package/dist/SelectList.js +59 -14
- package/dist/ThemeSelect.js +55 -4
- package/dist/apps.d.ts +1 -0
- package/dist/apps.js +50 -29
- package/dist/brand.js +251 -68
- package/dist/codemirror.js +116 -87
- package/dist/collections/CollectionGate.d.ts +52 -0
- package/dist/collections/CollectionGate.js +456 -0
- package/dist/collections/CollectionSaveWarning.d.ts +10 -0
- package/dist/collections/CollectionSaveWarning.js +28 -0
- package/dist/collections/CollectionSwitcher.d.ts +51 -0
- package/dist/collections/CollectionSwitcher.js +598 -0
- package/dist/collections/SetupReview.d.ts +9 -0
- package/dist/collections/SetupReview.js +216 -0
- package/dist/collections/copy.d.ts +100 -0
- package/dist/collections/copy.js +937 -0
- package/dist/collections/dialogs.d.ts +27 -0
- package/dist/collections/dialogs.js +169 -0
- package/dist/collections/model.d.ts +146 -0
- package/dist/collections/model.js +337 -0
- package/dist/collections/mount.d.ts +19 -0
- package/dist/collections/mount.js +56 -0
- package/dist/collections/parts.d.ts +86 -0
- package/dist/collections/parts.js +439 -0
- package/dist/collections/testing.d.ts +19 -0
- package/dist/collections/testing.js +39 -0
- package/dist/collections/use-collection-ui.d.ts +140 -0
- package/dist/collections/use-collection-ui.js +236 -0
- package/dist/collections.d.ts +19 -0
- package/dist/collections.js +13 -0
- package/dist/feedback-data.d.ts +13 -12
- package/dist/feedback-data.js +365 -168
- package/dist/flock.d.ts +63 -0
- package/dist/flock.js +140 -0
- package/dist/i18n.d.ts +6 -0
- package/dist/i18n.js +71 -0
- package/dist/locales/de/messages.json +1 -0
- package/dist/locales/en/messages.json +1 -0
- package/dist/locales/es/messages.json +1 -0
- package/dist/locales/fr/messages.json +1 -0
- package/dist/locales/it/messages.json +1 -0
- package/dist/locales/ja/messages.json +1 -0
- package/dist/locales/ko/messages.json +1 -0
- package/dist/locales/pt/messages.json +1 -0
- package/dist/locales/ru/messages.json +1 -0
- package/dist/locales/zh/messages.json +1 -0
- package/dist/mark-activity.js +82 -75
- package/dist/permission-selection.js +27 -17
- package/dist/popover.js +138 -130
- package/dist/screens.d.ts +20 -3
- package/dist/screens.js +275 -6
- package/dist/select-model.js +34 -28
- package/dist/text-diff.d.ts +1 -0
- package/dist/text-diff.js +106 -74
- package/dist/theme.js +34 -40
- package/package.json +56 -7
package/dist/codemirror.js
CHANGED
|
@@ -8,91 +8,120 @@ import { EditorView } from "@codemirror/view";
|
|
|
8
8
|
* `source` and `text` are records, `keyword` is a command, `namespace` a folder, `type` a type.
|
|
9
9
|
*/
|
|
10
10
|
export const mdbasePopupTheme = EditorView.theme({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
".
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
11
|
+
".cm-tooltip": {
|
|
12
|
+
border: "1px solid var(--color-border-strong)",
|
|
13
|
+
borderRadius: "var(--control-radius, 2px)",
|
|
14
|
+
color: "var(--color-text)",
|
|
15
|
+
backgroundColor: "var(--color-surface)",
|
|
16
|
+
boxShadow: "none",
|
|
17
|
+
fontFamily: "var(--sans)"
|
|
18
|
+
},
|
|
19
|
+
".cm-tooltip.cm-tooltip-autocomplete": {
|
|
20
|
+
padding: "4px"
|
|
21
|
+
},
|
|
22
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul": {
|
|
23
|
+
width: "min(440px, calc(100vw - 24px))",
|
|
24
|
+
minWidth: "0",
|
|
25
|
+
maxWidth: "none",
|
|
26
|
+
maxHeight: "min(252px, 45vh)",
|
|
27
|
+
fontFamily: "var(--sans)",
|
|
28
|
+
whiteSpace: "normal"
|
|
29
|
+
},
|
|
30
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul > li": {
|
|
31
|
+
display: "grid",
|
|
32
|
+
gridTemplateColumns: "20px minmax(0, 1fr)",
|
|
33
|
+
columnGap: "8px",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
padding: "6px 8px",
|
|
36
|
+
borderRadius: "var(--control-radius, 2px)",
|
|
37
|
+
lineHeight: "1.35"
|
|
38
|
+
},
|
|
39
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]": {
|
|
40
|
+
color: "var(--color-text)",
|
|
41
|
+
background: "var(--color-selected)"
|
|
42
|
+
},
|
|
43
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul > li > *": {
|
|
44
|
+
minWidth: "0",
|
|
45
|
+
overflow: "hidden",
|
|
46
|
+
textOverflow: "ellipsis",
|
|
47
|
+
whiteSpace: "nowrap"
|
|
48
|
+
},
|
|
49
|
+
".cm-completionIcon": {
|
|
50
|
+
gridRow: "1 / span 2",
|
|
51
|
+
width: "20px",
|
|
52
|
+
padding: "0",
|
|
53
|
+
color: "var(--color-text-muted)",
|
|
54
|
+
fontSize: "13px",
|
|
55
|
+
lineHeight: "20px",
|
|
56
|
+
textAlign: "center",
|
|
57
|
+
opacity: "1"
|
|
58
|
+
},
|
|
59
|
+
".cm-completionIcon-citation::after": {
|
|
60
|
+
content: '"@"',
|
|
61
|
+
color: "var(--color-accent)"
|
|
62
|
+
},
|
|
63
|
+
".cm-completionIcon-annotation::after": {
|
|
64
|
+
content: '"❝"',
|
|
65
|
+
color: "var(--color-accent)"
|
|
66
|
+
},
|
|
67
|
+
".cm-completionIcon-source::after, .cm-completionIcon-text::after": {
|
|
68
|
+
content: '"§"'
|
|
69
|
+
},
|
|
70
|
+
".cm-completionIcon-keyword::after": {
|
|
71
|
+
content: '"/"'
|
|
72
|
+
},
|
|
73
|
+
".cm-completionIcon-namespace::after": {
|
|
74
|
+
content: '"▤"'
|
|
75
|
+
},
|
|
76
|
+
".cm-completionIcon-type::after": {
|
|
77
|
+
content: '"T"'
|
|
78
|
+
},
|
|
79
|
+
".cm-completionLabel": {
|
|
80
|
+
gridColumn: "2",
|
|
81
|
+
color: "var(--color-text)",
|
|
82
|
+
fontSize: "13px",
|
|
83
|
+
fontWeight: "700"
|
|
84
|
+
},
|
|
85
|
+
".cm-completionMatchedText": {
|
|
86
|
+
textDecoration: "none",
|
|
87
|
+
color: "var(--color-accent)"
|
|
88
|
+
},
|
|
89
|
+
".cm-completionDetail": {
|
|
90
|
+
gridColumn: "2",
|
|
91
|
+
marginLeft: "0",
|
|
92
|
+
color: "var(--color-text-muted)",
|
|
93
|
+
fontSize: "11px",
|
|
94
|
+
fontStyle: "normal"
|
|
95
|
+
},
|
|
96
|
+
".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
|
|
97
|
+
color: "var(--color-text-faint)",
|
|
98
|
+
fontSize: "11px"
|
|
99
|
+
},
|
|
100
|
+
".cm-tooltip.cm-completionInfo": {
|
|
101
|
+
maxWidth: "min(320px, calc(100vw - 24px))",
|
|
102
|
+
margin: "0 4px",
|
|
103
|
+
padding: "10px 12px",
|
|
104
|
+
color: "var(--color-text-soft)",
|
|
105
|
+
fontSize: "12px",
|
|
106
|
+
lineHeight: "1.5",
|
|
107
|
+
whiteSpace: "pre-line"
|
|
108
|
+
},
|
|
109
|
+
".cm-tooltip.cm-tooltip-lint": {
|
|
110
|
+
padding: "4px",
|
|
111
|
+
fontSize: "12px"
|
|
112
|
+
},
|
|
113
|
+
".cm-diagnostic": {
|
|
114
|
+
padding: "4px 8px",
|
|
115
|
+
borderRadius: "var(--control-radius, 2px)",
|
|
116
|
+
fontFamily: "var(--sans)"
|
|
117
|
+
},
|
|
118
|
+
".cm-diagnostic-error": {
|
|
119
|
+
borderLeft: "3px solid var(--color-danger)"
|
|
120
|
+
},
|
|
121
|
+
".cm-diagnostic-warning": {
|
|
122
|
+
borderLeft: "3px solid var(--color-warning)"
|
|
123
|
+
},
|
|
124
|
+
".cm-diagnostic-info, .cm-diagnostic-hint": {
|
|
125
|
+
borderLeft: "3px solid var(--color-accent)"
|
|
126
|
+
}
|
|
98
127
|
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { MdbaseApplicationConnection } from "@mdbase-dev/sdk";
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
import { type CollectionView } from "./model.js";
|
|
4
|
+
import { type CollectionSection, type CollectionSectionItem, type CollectionUiOptions } from "./use-collection-ui.js";
|
|
5
|
+
/**
|
|
6
|
+
* The app's own actions on the gate's screens ("Try sample tasks"). A function
|
|
7
|
+
* gets the screen's view, to vary them by `view.kind` or return null.
|
|
8
|
+
*/
|
|
9
|
+
export type CollectionExtraActions = ReactNode | ((view: CollectionView) => ReactNode);
|
|
10
|
+
/** What `renderAppCollection` gets besides the open item. */
|
|
11
|
+
export interface AppCollectionContext {
|
|
12
|
+
readonly section: CollectionSection;
|
|
13
|
+
/** Close the item and return to the gate's list (with `onBeforeLeave("choose_another")`). */
|
|
14
|
+
readonly chooseAnother: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface CollectionGateOwnProps {
|
|
17
|
+
/** The app's actions: beside Sign in when signed out, in the footer on every other screen. */
|
|
18
|
+
readonly extraActions?: CollectionExtraActions;
|
|
19
|
+
/** "page" takes the viewport; "panel" sits inside the app's shell or a dialog. */
|
|
20
|
+
readonly layout?: "page" | "panel";
|
|
21
|
+
/** Call `mdbase.start()` when it hasn't started. Default true; safe with several gates. */
|
|
22
|
+
readonly autoStart?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CollectionGateProps extends CollectionUiOptions, CollectionGateOwnProps {
|
|
25
|
+
/** The app, rendered only once a collection is open and usable. */
|
|
26
|
+
readonly children: (connection: MdbaseApplicationConnection) => ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* The app, while one of its section items is open (`current`). Without it
|
|
29
|
+
* the gate keeps showing its screens. It takes precedence over the SDK's phase.
|
|
30
|
+
*/
|
|
31
|
+
readonly renderAppCollection?: ((item: CollectionSectionItem, context: AppCollectionContext) => ReactNode) | undefined;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Everything before a collection is open: sign-in, choosing, approval, setup
|
|
35
|
+
* review and problems. In phase `ready` it renders the app, with a banner
|
|
36
|
+
* above it for a live problem (migrating, update required, access removed).
|
|
37
|
+
*/
|
|
38
|
+
export declare function CollectionGate({ children, renderAppCollection, extraActions, layout, autoStart, ...options }: CollectionGateProps): JSX.Element;
|
|
39
|
+
export interface CollectionPanelProps extends CollectionUiOptions, Omit<CollectionGateOwnProps, "layout"> {
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* For write-first apps and settings dialogs: the gate's screens in a panel and,
|
|
43
|
+
* once a collection is open, the switcher's list inline.
|
|
44
|
+
*/
|
|
45
|
+
export declare function CollectionPanel({ extraActions, autoStart, ...options }: CollectionPanelProps): JSX.Element;
|
|
46
|
+
export interface CollectionProblemProps extends CollectionUiOptions {
|
|
47
|
+
/** An error from the app's own call (a write that was refused). Default: the current phase's problem. */
|
|
48
|
+
readonly problem?: unknown;
|
|
49
|
+
readonly variant?: "block" | "banner";
|
|
50
|
+
}
|
|
51
|
+
/** One problem with its fix, for banners and toasts inside the app. Renders nothing when there is none. */
|
|
52
|
+
export declare function CollectionProblem({ problem, variant, ...options }: CollectionProblemProps): JSX.Element | null;
|