@maple-kit/ui 0.9.0 → 0.11.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/README.md +5 -2
- package/dist/cx.js +6 -0
- package/dist/icons/chevron.d.ts +4 -0
- package/dist/icons/chevron.js +8 -0
- package/dist/icons/code.d.ts +4 -0
- package/dist/icons/code.js +5 -0
- package/dist/icons/index.d.ts +4 -1
- package/dist/icons/index.js +4 -1
- package/dist/icons/link.d.ts +4 -0
- package/dist/icons/link.js +5 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/island/account.js +2 -1
- package/dist/island/approve.js +2 -1
- package/dist/island/content.js +2 -1
- package/dist/island/filters.js +2 -1
- package/dist/island/header.js +2 -1
- package/dist/island/island.js +2 -1
- package/dist/island/item.js +2 -1
- package/dist/island/language.js +4 -8
- package/dist/island/list.js +2 -1
- package/dist/island/new-comment.js +2 -1
- package/dist/island/settings.js +2 -1
- package/dist/island/trigger.js +2 -1
- package/dist/island/unsent.js +2 -1
- package/dist/island/wordmark.js +2 -1
- package/dist/maple.d.ts +2 -1
- package/dist/maple.js +3 -2
- package/dist/marks/css.js +2 -3
- package/dist/mock/css.js +427 -0
- package/dist/mock/index.d.ts +4 -0
- package/dist/mock/index.js +4 -0
- package/dist/mock/language.d.ts +39 -0
- package/dist/mock/language.js +66 -0
- package/dist/mock/layers.js +168 -0
- package/dist/mock/menu.js +85 -0
- package/dist/mock/mock.d.ts +18 -0
- package/dist/mock/mock.js +200 -0
- package/dist/mock/sheet.d.ts +8 -0
- package/dist/mock/sheet.js +9 -0
- package/dist/notice/notice.js +2 -1
- package/dist/part.js +1 -4
- package/dist/picker/language.d.ts +1 -1
- package/dist/picker/language.js +1 -1
- package/dist/picker/picker.js +5 -12
- package/dist/root.js +2 -1
- package/dist/sheet-base.d.ts +11 -0
- package/dist/sheet-base.js +173 -0
- package/dist/stylesheet.d.ts +3 -12
- package/dist/stylesheet.js +5 -167
- package/dist/tip.js +1 -1
- package/dist/tokens.js +6 -2
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -17,8 +17,11 @@ npm install @maple-kit/ui
|
|
|
17
17
|
## What is in it
|
|
18
18
|
|
|
19
19
|
`@maple-kit/ui/maple` is the whole overlay as one component. The parts are also
|
|
20
|
-
exported on their own: `/marks`, `/island`, `/composer`, `/picker`, `/notice
|
|
21
|
-
and `/icons`.
|
|
20
|
+
exported on their own: `/marks`, `/island`, `/composer`, `/picker`, `/notice`,
|
|
21
|
+
`/mock` and `/icons`.
|
|
22
|
+
|
|
23
|
+
`@maple-kit/ui/mock` is Maple Mock's box, `<MapleMock />`, for a page that
|
|
24
|
+
mocks without the review overlay. Inside `<Maple />` it is already mounted.
|
|
22
25
|
|
|
23
26
|
Everything renders inside one shadow root, styled only through
|
|
24
27
|
`new CSSStyleSheet()` and `adoptedStyleSheets`, with positions set by
|
package/dist/cx.js
ADDED
package/dist/icons/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { ICON_SIZE, IconComponent, IconProps, IconSpec, createIcon } from "./icon.js";
|
|
2
2
|
import { BranchIcon } from "./branch.js";
|
|
3
|
+
import { ChevronIcon } from "./chevron.js";
|
|
4
|
+
import { CodeIcon } from "./code.js";
|
|
3
5
|
import { CogIcon } from "./cog.js";
|
|
4
6
|
import { CommitIcon } from "./commit.js";
|
|
5
7
|
import { IconCrossfade, IconCrossfadeProps } from "./crossfade.js";
|
|
6
8
|
import { ElementIcon } from "./element.js";
|
|
9
|
+
import { LinkIcon } from "./link.js";
|
|
7
10
|
import { NoPlaceIcon } from "./noplace.js";
|
|
8
11
|
import { RegionIcon } from "./region.js";
|
|
9
12
|
import { SmileyIcon } from "./smiley.js";
|
|
10
13
|
import { SparkleIcon } from "./sparkle.js";
|
|
11
14
|
import { TargetIcon } from "./target.js";
|
|
12
15
|
import { TextIcon } from "./text.js";
|
|
13
|
-
export { BranchIcon, CogIcon, CommitIcon, ElementIcon, ICON_SIZE, type IconComponent, IconCrossfade, type IconCrossfadeProps, type IconProps, type IconSpec, NoPlaceIcon, RegionIcon, SmileyIcon, SparkleIcon, TargetIcon, TextIcon, createIcon };
|
|
16
|
+
export { BranchIcon, ChevronIcon, CodeIcon, CogIcon, CommitIcon, ElementIcon, ICON_SIZE, type IconComponent, IconCrossfade, type IconCrossfadeProps, type IconProps, type IconSpec, LinkIcon, NoPlaceIcon, RegionIcon, SmileyIcon, SparkleIcon, TargetIcon, TextIcon, createIcon };
|
package/dist/icons/index.js
CHANGED
|
@@ -6,8 +6,11 @@ import { ElementIcon } from "./element.js";
|
|
|
6
6
|
import { RegionIcon } from "./region.js";
|
|
7
7
|
import { TextIcon } from "./text.js";
|
|
8
8
|
import { CogIcon } from "./cog.js";
|
|
9
|
+
import { CodeIcon } from "./code.js";
|
|
10
|
+
import { LinkIcon } from "./link.js";
|
|
11
|
+
import { ChevronIcon } from "./chevron.js";
|
|
9
12
|
import { BranchIcon } from "./branch.js";
|
|
10
13
|
import { CommitIcon } from "./commit.js";
|
|
11
14
|
import { NoPlaceIcon } from "./noplace.js";
|
|
12
15
|
import { TargetIcon } from "./target.js";
|
|
13
|
-
export { BranchIcon, CogIcon, CommitIcon, ElementIcon, ICON_SIZE, IconCrossfade, NoPlaceIcon, RegionIcon, SmileyIcon, SparkleIcon, TargetIcon, TextIcon, createIcon };
|
|
16
|
+
export { BranchIcon, ChevronIcon, CodeIcon, CogIcon, CommitIcon, ElementIcon, ICON_SIZE, IconCrossfade, LinkIcon, NoPlaceIcon, RegionIcon, SmileyIcon, SparkleIcon, TargetIcon, TextIcon, createIcon };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { PartAttributes, PartConfidence, PartForm, PartProvenance, PartState, Po
|
|
|
5
5
|
import { DETAIL_COPY, ORPHAN_LABELS, ORPHAN_ORDER, ORPHAN_SENTENCES, PROVENANCE_SENTENCES, RUNG_LABELS, STATUS_LABELS, STATUS_SENTENCES, orphanTitle, rungLabel } from "./language.js";
|
|
6
6
|
import { MapleRoot, MapleRootProps, ThemePreference } from "./root.js";
|
|
7
7
|
import { REVIEWER_SLOT_COUNT, SLOT_INK_PROPERTY, SLOT_PROPERTY, applyReviewerSlot, slotColor, slotInk } from "./slots.js";
|
|
8
|
-
import {
|
|
8
|
+
import { SCHEME_ATTRIBUTE } from "./sheet-base.js";
|
|
9
|
+
import { OVERLAY_CSS } from "./stylesheet.js";
|
|
9
10
|
import { OverlayTheme, useOverlayScheme } from "./theme.js";
|
|
10
11
|
import { Tip, TipProps, tipSpot } from "./tip.js";
|
|
11
12
|
export { AsChildError, type AsChildProps, DETAIL_COPY, MOTION_TOKENS, MapleRoot, type MapleRootProps, MapleUiContextError, type MapleUiContextValue, ORPHAN_LABELS, ORPHAN_ORDER, ORPHAN_SENTENCES, OVERLAY_CSS, type OverlayTheme, PROVENANCE_SENTENCES, type PartAttributes, type PartConfidence, type PartForm, type PartProvenance, type PartState, type PointerState, RADIUS_TOKENS, REDUCED_MOTION_TOKENS, REVIEWER_SLOT_COUNT, RUNG_LABELS, RUNTIME_TOKENS, MapleRoot as Root, SCHEME_ATTRIBUTE, SHEET_BREAKPOINT_PX, SLOT_INK_PROPERTY, SLOT_PROPERTY, STATUS_LABELS, STATUS_SENTENCES, Slot, type SlotProps, type ThemePreference, Tip, type TipProps, applyReviewerSlot, composeRefs, confidenceFor, dataAttributes, formFor, mergeProps, orphanTitle, pointerAttributes, rungLabel, slotColor, slotInk, tipSpot, useMapleUi, useOverlayScheme };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,8 @@ import { MapleUiContextError, useMapleUi } from "./context.js";
|
|
|
2
2
|
import { confidenceFor, dataAttributes, formFor, pointerAttributes } from "./data.js";
|
|
3
3
|
import { DETAIL_COPY, ORPHAN_LABELS, ORPHAN_ORDER, ORPHAN_SENTENCES, PROVENANCE_SENTENCES, RUNG_LABELS, STATUS_LABELS, STATUS_SENTENCES, orphanTitle, rungLabel } from "./language.js";
|
|
4
4
|
import { MOTION_TOKENS, RADIUS_TOKENS, REDUCED_MOTION_TOKENS, RUNTIME_TOKENS, SHEET_BREAKPOINT_PX } from "./tokens.js";
|
|
5
|
-
import {
|
|
5
|
+
import { SCHEME_ATTRIBUTE } from "./sheet-base.js";
|
|
6
|
+
import { OVERLAY_CSS } from "./stylesheet.js";
|
|
6
7
|
import { useOverlayScheme } from "./theme.js";
|
|
7
8
|
import { MapleRoot } from "./root.js";
|
|
8
9
|
import { AsChildError, Slot, composeRefs, mergeProps } from "./slot.js";
|
package/dist/island/account.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { renderPart } from "../part.js";
|
|
2
3
|
import { ACCOUNT_COPY } from "./language.js";
|
|
3
4
|
import { createElement, forwardRef } from "react";
|
|
4
5
|
import { useGitHubLink, useMapleClient } from "@maple-kit/react";
|
package/dist/island/approve.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { renderPart } from "../part.js";
|
|
2
3
|
import { APPROVE_COPY } from "./language.js";
|
|
3
4
|
import { createElement, forwardRef } from "react";
|
|
4
5
|
import { useMaple, useMapleClient } from "@maple-kit/react";
|
package/dist/island/content.js
CHANGED
package/dist/island/filters.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
2
|
import { Tip } from "../tip.js";
|
|
3
|
+
import { renderPart } from "../part.js";
|
|
3
4
|
import { FILTERS_LABEL, FILTER_LABELS, FILTER_ORDER, TALLY_ORDER, tallyTitle } from "./language.js";
|
|
4
5
|
import { countsFor } from "./comments.js";
|
|
5
6
|
import { listId, useIsland } from "./context.js";
|
package/dist/island/header.js
CHANGED
package/dist/island/island.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMapleUi } from "../context.js";
|
|
2
2
|
import { composeRefs } from "../slot.js";
|
|
3
|
-
import { cx
|
|
3
|
+
import { cx } from "../cx.js";
|
|
4
|
+
import { renderPart } from "../part.js";
|
|
4
5
|
import { numbersFor, resolutionsFor } from "./comments.js";
|
|
5
6
|
import { IslandContext } from "./context.js";
|
|
6
7
|
import { useDrag } from "./drag.js";
|
package/dist/island/item.js
CHANGED
|
@@ -2,8 +2,9 @@ import { dataAttributes, formFor } from "../data.js";
|
|
|
2
2
|
import { PROVENANCE_SENTENCES, STATUS_LABELS, STATUS_SENTENCES } from "../language.js";
|
|
3
3
|
import { composeRefs } from "../slot.js";
|
|
4
4
|
import { applyReviewerSlot } from "../slots.js";
|
|
5
|
-
import { cx
|
|
5
|
+
import { cx } from "../cx.js";
|
|
6
6
|
import { Tip } from "../tip.js";
|
|
7
|
+
import { renderPart } from "../part.js";
|
|
7
8
|
import { ISLAND_COPY, kindPhrase } from "./language.js";
|
|
8
9
|
import { useIsland } from "./context.js";
|
|
9
10
|
import { MapleLeaf } from "../marks/shape.js";
|
package/dist/island/language.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { COMMENT_SHORTCUT } from "@maple-kit/core/client";
|
|
1
2
|
//#region src/island/language.ts
|
|
2
3
|
const FILTER_LABELS = {
|
|
3
4
|
all: "All",
|
|
@@ -23,11 +24,6 @@ function tallyTitle(filter, count) {
|
|
|
23
24
|
const many = count === 1 ? "comment" : "comments";
|
|
24
25
|
return `${String(count)} ${FILTER_LABELS[filter].toLowerCase()} ${many} — click to show only these`;
|
|
25
26
|
}
|
|
26
|
-
const PICK_ORDER = [
|
|
27
|
-
"element",
|
|
28
|
-
"text",
|
|
29
|
-
"region"
|
|
30
|
-
];
|
|
31
27
|
const PICK_LABELS = {
|
|
32
28
|
element: "Element",
|
|
33
29
|
region: "Region",
|
|
@@ -135,8 +131,8 @@ function openLabel(count) {
|
|
|
135
131
|
function triggerLabel(count) {
|
|
136
132
|
return `Open Maple: ${openLabel(count)}`;
|
|
137
133
|
}
|
|
138
|
-
function pickTitle(kind) {
|
|
139
|
-
return `Comment on ${kind} — press
|
|
134
|
+
function pickTitle(kind, key = COMMENT_SHORTCUT) {
|
|
135
|
+
return `Comment on ${kind} — press ${key} again while picking to cycle`;
|
|
140
136
|
}
|
|
141
137
|
function kindPhrase(kind, human) {
|
|
142
138
|
if (human === void 0) return "somewhere on this page";
|
|
@@ -144,4 +140,4 @@ function kindPhrase(kind, human) {
|
|
|
144
140
|
return kind === "region" ? `an area of ${human}` : human;
|
|
145
141
|
}
|
|
146
142
|
//#endregion
|
|
147
|
-
export { ACCOUNT_COPY, APPROVE_COPY, CORNER_LABELS, CORNER_ORDER, FILTERS_LABEL, FILTER_LABELS, FILTER_ORDER, ISLAND_COPY, PICK_LABELS,
|
|
143
|
+
export { ACCOUNT_COPY, APPROVE_COPY, CORNER_LABELS, CORNER_ORDER, FILTERS_LABEL, FILTER_LABELS, FILTER_ORDER, ISLAND_COPY, PICK_LABELS, SETTINGS_COPY, TALLY_ORDER, THEME_LABELS, THEME_TITLES, UNSENT_COPY, kindPhrase, openLabel, pickTitle, tallyTitle, triggerLabel };
|
package/dist/island/list.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { renderPart } from "../part.js";
|
|
2
3
|
import { FILTER_LABELS, ISLAND_COPY } from "./language.js";
|
|
3
4
|
import { byReason } from "./comments.js";
|
|
4
5
|
import { listId, reasonOf, useIsland } from "./context.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { dataAttributes } from "../data.js";
|
|
2
|
-
import { cx
|
|
2
|
+
import { cx } from "../cx.js";
|
|
3
3
|
import { ElementIcon } from "../icons/element.js";
|
|
4
4
|
import { RegionIcon } from "../icons/region.js";
|
|
5
5
|
import { TextIcon } from "../icons/text.js";
|
|
6
|
+
import { renderPart } from "../part.js";
|
|
6
7
|
import { ISLAND_COPY, PICK_LABELS, pickTitle } from "./language.js";
|
|
7
8
|
import { useIsland } from "./context.js";
|
|
8
9
|
import { createElement, forwardRef } from "react";
|
package/dist/island/settings.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { renderPart } from "../part.js";
|
|
2
3
|
import { CORNER_LABELS, CORNER_ORDER, ISLAND_COPY, SETTINGS_COPY, THEME_LABELS, THEME_TITLES } from "./language.js";
|
|
3
4
|
import { Account } from "./account.js";
|
|
4
5
|
import { useIsland } from "./context.js";
|
package/dist/island/trigger.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dataAttributes } from "../data.js";
|
|
2
|
-
import { cx
|
|
2
|
+
import { cx } from "../cx.js";
|
|
3
|
+
import { renderPart } from "../part.js";
|
|
3
4
|
import { openLabel, triggerLabel } from "./language.js";
|
|
4
5
|
import { useIsland } from "./context.js";
|
|
5
6
|
import { Leaf } from "./leaf.js";
|
package/dist/island/unsent.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { renderPart } from "../part.js";
|
|
2
3
|
import { UNSENT_COPY } from "./language.js";
|
|
3
4
|
import { createElement, forwardRef, useState } from "react";
|
|
4
5
|
import { useMaple, useMapleClient } from "@maple-kit/react";
|
package/dist/island/wordmark.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { cx
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { renderPart } from "../part.js";
|
|
2
3
|
import { ISLAND_COPY } from "./language.js";
|
|
3
4
|
import { PIXEL_LEAF_SHADES, PIXEL_LEAF_VIEW_BOX } from "../marks/pixel-leaf.js";
|
|
4
5
|
import { WORDMARK_PATH, WORDMARK_RATIO, WORDMARK_VIEW_BOX } from "../marks/wordmark.js";
|
package/dist/maple.d.ts
CHANGED
|
@@ -19,7 +19,8 @@ export interface MapleProps extends MapleRootProps {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* The whole reviewer interface: the marks on the page, the picker, the
|
|
22
|
-
* inventory and the composer, over one shadow root and one controller
|
|
22
|
+
* inventory and the composer, over one shadow root and one controller, and the
|
|
23
|
+
* mock box on a page where Maple Mock's transport is installed.
|
|
23
24
|
*/
|
|
24
25
|
export declare const Maple: import("react").ForwardRefExoticComponent<MapleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
25
26
|
//#endregion
|
package/dist/maple.js
CHANGED
|
@@ -7,7 +7,6 @@ import { MapleComposer } from "./composer/composer.js";
|
|
|
7
7
|
import { MapleDetail } from "./composer/detail.js";
|
|
8
8
|
import { MapleScoreCard } from "./composer/score.js";
|
|
9
9
|
import { MapleTarget } from "./composer/target.js";
|
|
10
|
-
import { PICK_ORDER } from "./island/language.js";
|
|
11
10
|
import { Approve } from "./island/approve.js";
|
|
12
11
|
import { IslandContent } from "./island/content.js";
|
|
13
12
|
import { Filters } from "./island/filters.js";
|
|
@@ -20,9 +19,11 @@ import { Settings } from "./island/settings.js";
|
|
|
20
19
|
import { IslandTrigger } from "./island/trigger.js";
|
|
21
20
|
import { Unsent } from "./island/unsent.js";
|
|
22
21
|
import { MapleMarkLayer } from "./marks/layer.js";
|
|
22
|
+
import { MapleMock } from "./mock/mock.js";
|
|
23
23
|
import { MapleNotice } from "./notice/notice.js";
|
|
24
24
|
import { MaplePicker } from "./picker/picker.js";
|
|
25
25
|
import { createElement, forwardRef } from "react";
|
|
26
|
+
import { PICK_ORDER } from "@maple-kit/core/client";
|
|
26
27
|
//#region src/maple.ts
|
|
27
28
|
const LOAD_CALLS = [
|
|
28
29
|
"load",
|
|
@@ -38,7 +39,7 @@ const Maple = forwardRef(function Maple(props, ref) {
|
|
|
38
39
|
}, createElement(MapleMarkLayer, { key: "marks" }), createElement(MaplePicker, {
|
|
39
40
|
key: "picker",
|
|
40
41
|
...hint === void 0 ? {} : { hint }
|
|
41
|
-
}), inventory(root.branch, root.label, defaultOpen === true), composer(leave, attachments), children);
|
|
42
|
+
}), inventory(root.branch, root.label, defaultOpen === true), composer(leave, attachments), createElement(MapleMock, { key: "mock" }), children);
|
|
42
43
|
});
|
|
43
44
|
function inventory(branch, label, defaultOpen) {
|
|
44
45
|
return createElement(Island, {
|
package/dist/marks/css.js
CHANGED
|
@@ -232,9 +232,8 @@ function ringCss() {
|
|
|
232
232
|
will-change: transform;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
235
|
+
/* No quieter hovered ring: pointing at a mark or tabbing onto it is asking
|
|
236
|
+
"which one", and a hairline answered it too faintly to be seen. */
|
|
238
237
|
|
|
239
238
|
/* A passage is its own lines and nothing else: the box around them is the
|
|
240
239
|
paragraph, and outlining that says the comment is on the paragraph. */
|