@monkey-mini-app/ui 0.1.1 → 0.1.4
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 +12 -6
- package/dist/globals.css +1 -1
- package/dist/index.js +12 -2
- package/dist/manifest.json +6 -6
- package/dist/runtime.js +9 -0
- package/dist/sdk.js +158 -0
- package/dist/src/blocks/activity-feed.tsx +7 -0
- package/dist/src/blocks/app-shell.tsx +1 -0
- package/dist/src/blocks/attachment-gallery.tsx +7 -0
- package/dist/src/blocks/bar-chart.tsx +11 -0
- package/dist/src/blocks/comment-thread.tsx +7 -0
- package/dist/src/blocks/dashboard-shell.tsx +109 -0
- package/dist/src/blocks/description-list.tsx +7 -0
- package/dist/src/blocks/detail-panel.tsx +1 -0
- package/dist/src/blocks/donut-chart.tsx +7 -0
- package/dist/src/blocks/env-badge.tsx +7 -0
- package/dist/src/blocks/env-table.tsx +316 -0
- package/dist/src/blocks/file-tree.tsx +7 -0
- package/dist/src/blocks/filter-bar.tsx +1 -0
- package/dist/src/blocks/form-sheet.tsx +160 -0
- package/dist/src/blocks/gauge.tsx +7 -0
- package/dist/src/blocks/list-detail.tsx +121 -0
- package/dist/src/blocks/notification-center.tsx +7 -0
- package/dist/src/blocks/page-header.tsx +1 -0
- package/dist/src/blocks/progress-ring.tsx +7 -0
- package/dist/src/blocks/radar-chart.tsx +7 -0
- package/dist/src/blocks/request-inspector.tsx +7 -0
- package/dist/src/blocks/reveal.tsx +56 -0
- package/dist/src/blocks/run-timeline.tsx +7 -0
- package/dist/src/blocks/scrollspy.tsx +7 -0
- package/dist/src/blocks/settings-split.tsx +154 -0
- package/dist/src/blocks/severity-chip.tsx +7 -0
- package/dist/src/blocks/sparkline.tsx +7 -0
- package/dist/src/blocks/stat-card.tsx +1 -0
- package/dist/src/blocks/status-badge.tsx +1 -0
- package/dist/src/blocks/table-page.tsx +83 -0
- package/dist/src/blocks/terminal.tsx +21 -3
- package/dist/src/blocks/test-step-list.tsx +7 -0
- package/dist/src/blocks/trend-card.tsx +7 -0
- package/dist/src/blocks/wizard-shell.tsx +132 -0
- package/dist/src/cdn-modules.d.ts +5 -0
- package/dist/src/components/accordion.tsx +7 -0
- package/dist/src/components/alert-dialog.tsx +7 -0
- package/dist/src/components/alert.tsx +7 -0
- package/dist/src/components/aspect-ratio.tsx +4 -0
- package/dist/src/components/attachment.tsx +4 -0
- package/dist/src/components/avatar.tsx +4 -0
- package/dist/src/components/badge.tsx +7 -0
- package/dist/src/components/breadcrumb.tsx +4 -0
- package/dist/src/components/bubble.tsx +4 -0
- package/dist/src/components/button-group.tsx +6 -0
- package/dist/src/components/button.tsx +7 -0
- package/dist/src/components/calendar.tsx +4 -0
- package/dist/src/components/card.tsx +8 -1
- package/dist/src/components/chart.tsx +7 -0
- package/dist/src/components/checkbox.tsx +5 -0
- package/dist/src/components/collapsible.tsx +4 -0
- package/dist/src/components/combobox.tsx +4 -0
- package/dist/src/components/command.tsx +6 -0
- package/dist/src/components/context-menu.tsx +4 -0
- package/dist/src/components/dialog.tsx +21 -0
- package/dist/src/components/drawer.tsx +4 -0
- package/dist/src/components/dropdown-menu.tsx +7 -0
- package/dist/src/components/empty.tsx +7 -0
- package/dist/src/components/field.tsx +6 -0
- package/dist/src/components/hover-card.tsx +4 -0
- package/dist/src/components/input-group.tsx +4 -0
- package/dist/src/components/input.tsx +7 -0
- package/dist/src/components/item.tsx +4 -0
- package/dist/src/components/kbd.tsx +4 -0
- package/dist/src/components/label.tsx +7 -0
- package/dist/src/components/marker.tsx +4 -0
- package/dist/src/components/menubar.tsx +4 -0
- package/dist/src/components/message-scroller.tsx +4 -0
- package/dist/src/components/message.tsx +4 -0
- package/dist/src/components/native-select.tsx +4 -0
- package/dist/src/components/navigation-menu.tsx +4 -0
- package/dist/src/components/pagination.tsx +4 -0
- package/dist/src/components/popover.tsx +7 -0
- package/dist/src/components/progress.tsx +7 -0
- package/dist/src/components/questionnaire.tsx +4 -0
- package/dist/src/components/radio-group.tsx +4 -0
- package/dist/src/components/resizable.tsx +7 -0
- package/dist/src/components/scroll-area.tsx +4 -0
- package/dist/src/components/select.tsx +7 -0
- package/dist/src/components/separator.tsx +5 -0
- package/dist/src/components/sheet.tsx +22 -0
- package/dist/src/components/sidebar.tsx +4 -0
- package/dist/src/components/skeleton.tsx +7 -0
- package/dist/src/components/slider.tsx +4 -0
- package/dist/src/components/spinner.tsx +6 -0
- package/dist/src/components/switch.tsx +7 -0
- package/dist/src/components/table.tsx +7 -0
- package/dist/src/components/tabs.tsx +7 -0
- package/dist/src/components/textarea.tsx +7 -0
- package/dist/src/components/toast.tsx +7 -0
- package/dist/src/components/toggle-group.tsx +4 -0
- package/dist/src/components/toggle.tsx +4 -0
- package/dist/src/components/tooltip.tsx +7 -0
- package/dist/src/composites/autocomplete.tsx +7 -0
- package/dist/src/composites/cascader.tsx +7 -0
- package/dist/src/composites/color-picker.tsx +7 -0
- package/dist/src/composites/confirm-dialog.tsx +7 -0
- package/dist/src/composites/copyable.tsx +9 -1
- package/dist/src/composites/currency-input.tsx +7 -0
- package/dist/src/composites/date-picker.tsx +7 -0
- package/dist/src/composites/date-range-picker.tsx +4 -0
- package/dist/src/composites/date-time-picker.tsx +7 -0
- package/dist/src/composites/date-time-range-picker.tsx +7 -0
- package/dist/src/composites/duration-input.tsx +7 -0
- package/dist/src/composites/mini-calendar.tsx +7 -0
- package/dist/src/composites/number-field.tsx +7 -0
- package/dist/src/composites/password-field.tsx +7 -0
- package/dist/src/composites/phone-input.tsx +7 -0
- package/dist/src/composites/rating.tsx +7 -0
- package/dist/src/composites/relative-date-picker.tsx +7 -0
- package/dist/src/composites/search-input.tsx +7 -0
- package/dist/src/composites/slider-range.tsx +7 -0
- package/dist/src/composites/tag-input.tsx +7 -0
- package/dist/src/composites/time-picker.tsx +11 -1
- package/dist/src/composites/time-range-picker.tsx +7 -0
- package/dist/src/composites/timezone-select.tsx +7 -0
- package/dist/src/composites/transfer.tsx +7 -0
- package/dist/src/composites/user-picker.tsx +7 -0
- package/dist/src/hooks/use-html-dark.ts +37 -0
- package/dist/src/hooks/use-mobile.ts +3 -0
- package/dist/src/i18n/en.ts +109 -2
- package/dist/src/i18n/zh.ts +99 -2
- package/dist/src/index.ts +147 -134
- package/dist/src/lib/clipboard.ts +10 -0
- package/dist/src/lib/illustrations.tsx +2 -2
- package/dist/src/products/code-block.tsx +35 -18
- package/dist/src/products/code-editor.tsx +156 -24
- package/dist/src/products/commit-graph.tsx +644 -0
- package/dist/src/products/data-grid.tsx +2 -1
- package/dist/src/products/diff-viewer.tsx +104 -8
- package/dist/src/products/event-calendar.tsx +28 -823
- package/dist/src/products/file-dropzone.tsx +7 -0
- package/dist/src/products/full-calendar/animations.ts +38 -0
- package/dist/src/products/full-calendar/calendar-body.tsx +77 -0
- package/dist/src/products/full-calendar/constants.ts +10 -0
- package/dist/src/products/full-calendar/contexts/calendar-context.tsx +255 -0
- package/dist/src/products/full-calendar/contexts/dnd-context.tsx +157 -0
- package/dist/src/products/full-calendar/dialogs/add-edit-event-dialog.tsx +187 -0
- package/dist/src/products/full-calendar/dialogs/delete-event-dialog.tsx +39 -0
- package/dist/src/products/full-calendar/dialogs/event-details-dialog.tsx +100 -0
- package/dist/src/products/full-calendar/dialogs/events-list-dialog.tsx +87 -0
- package/dist/src/products/full-calendar/dnd/draggable-event.tsx +45 -0
- package/dist/src/products/full-calendar/dnd/droppable-area.tsx +45 -0
- package/dist/src/products/full-calendar/dnd/resizable-event.tsx +179 -0
- package/dist/src/products/full-calendar/header/calendar-header.tsx +65 -0
- package/dist/src/products/full-calendar/header/date-navigator.tsx +110 -0
- package/dist/src/products/full-calendar/header/filter.tsx +58 -0
- package/dist/src/products/full-calendar/header/today-button.tsx +45 -0
- package/dist/src/products/full-calendar/header/user-select.tsx +64 -0
- package/dist/src/products/full-calendar/header/view-tabs.tsx +36 -0
- package/dist/src/products/full-calendar/helpers.ts +453 -0
- package/dist/src/products/full-calendar/hooks/use-time-range-create.ts +152 -0
- package/dist/src/products/full-calendar/hooks.ts +70 -0
- package/dist/src/products/full-calendar/interfaces.ts +23 -0
- package/dist/src/products/full-calendar/settings/settings.tsx +80 -0
- package/dist/src/products/full-calendar/shims/avatar-group.tsx +16 -0
- package/dist/src/products/full-calendar/shims/day-picker.tsx +1 -0
- package/dist/src/products/full-calendar/shims/motion.tsx +97 -0
- package/dist/src/products/full-calendar/shims/next-themes.ts +6 -0
- package/dist/src/products/full-calendar/shims/re-resizable.tsx +25 -0
- package/dist/src/products/full-calendar/shims/sonner.ts +4 -0
- package/dist/src/products/full-calendar/types.ts +8 -0
- package/dist/src/products/full-calendar/views/agenda-view/agenda-events.tsx +140 -0
- package/dist/src/products/full-calendar/views/month-view/calendar-month-view.tsx +69 -0
- package/dist/src/products/full-calendar/views/month-view/day-cell.tsx +201 -0
- package/dist/src/products/full-calendar/views/month-view/event-bullet.tsx +40 -0
- package/dist/src/products/full-calendar/views/month-view/month-event-badge.tsx +143 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/calendar-day-view.tsx +295 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/calendar-time-line.tsx +35 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/calendar-week-view.tsx +253 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.tsx +73 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/event-block.tsx +114 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/render-grouped-events.tsx +49 -0
- package/dist/src/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.tsx +143 -0
- package/dist/src/products/full-calendar/views/year-view/calendar-year-view.tsx +161 -0
- package/dist/src/products/gantt.tsx +7 -0
- package/dist/src/products/jira-wiki.tsx +1 -0
- package/dist/src/products/jql-input.tsx +340 -37
- package/dist/src/products/json-viewer.tsx +7 -0
- package/dist/src/products/kanban-issue-panel.tsx +7 -0
- package/dist/src/products/kanban.tsx +1 -0
- package/dist/src/products/log-viewer.tsx +390 -18
- package/dist/src/products/markdown-editor.tsx +21 -6
- package/dist/src/products/markdown.tsx +7 -0
- package/dist/src/products/rich-text-editor.tsx +65 -59
- package/dist/src/products/sortable-list.tsx +7 -0
- package/dist/src/products/stepper.tsx +219 -70
- package/dist/src/products/timeline.tsx +7 -0
- package/dist/src/products/tree-view.tsx +7 -0
- package/dist/src/sdk/app-error-boundary.tsx +240 -0
- package/dist/src/sdk/app-id.ts +7 -0
- package/dist/src/sdk/use-app.ts +126 -0
- package/dist/src/styles/globals.css +1 -0
- package/dist/vendors/lodash.js +20 -0
- package/dist/vendors/motion.js +12 -0
- package/package.json +20 -19
- package/dist/src/products/jql-language.ts +0 -70
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monkey-mini-app/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
@@ -8,20 +8,14 @@
|
|
|
8
8
|
"typecheck": "tsc --noEmit",
|
|
9
9
|
"test": "vitest run",
|
|
10
10
|
"test:watch": "vitest",
|
|
11
|
-
"
|
|
12
|
-
"build
|
|
13
|
-
"
|
|
14
|
-
"
|
|
11
|
+
"build:dist": "node ../../scripts/build/ui.mjs",
|
|
12
|
+
"build": "node ../../scripts/build/ui.mjs && node ../../scripts/build/sdk.mjs",
|
|
13
|
+
"prepack": "node ../../scripts/build/ui.mjs && node ../../scripts/build/sdk.mjs",
|
|
14
|
+
"gen:skill": "node ../../scripts/gen/skill/index.mjs",
|
|
15
|
+
"build:iframe": "node ../../scripts/build/sdk.mjs"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@base-ui/react": "^1.7.0",
|
|
18
|
-
"@codemirror/autocomplete": "^6.20.3",
|
|
19
|
-
"@codemirror/lang-html": "^6.4.12",
|
|
20
|
-
"@codemirror/lang-javascript": "^6.2.5",
|
|
21
|
-
"@codemirror/lang-json": "^6.0.2",
|
|
22
|
-
"@codemirror/lang-markdown": "^6.5.2",
|
|
23
|
-
"@codemirror/language": "^6.12.4",
|
|
24
|
-
"@codemirror/theme-one-dark": "^6.1.3",
|
|
25
19
|
"@dnd-kit/core": "^6.3.1",
|
|
26
20
|
"@dnd-kit/sortable": "^10.0.0",
|
|
27
21
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -29,17 +23,14 @@
|
|
|
29
23
|
"@shadcn/react": "^0.3.0",
|
|
30
24
|
"@tanstack/react-table": "^8.21.3",
|
|
31
25
|
"@tanstack/react-virtual": "^3.13.12",
|
|
32
|
-
"@tiptap/extension-placeholder": "^3.30.3",
|
|
33
|
-
"@tiptap/pm": "^3.30.3",
|
|
34
|
-
"@tiptap/react": "^3.30.3",
|
|
35
|
-
"@tiptap/starter-kit": "^3.30.3",
|
|
36
|
-
"@uiw/react-codemirror": "^4.25.11",
|
|
37
26
|
"class-variance-authority": "^0.7.1",
|
|
38
27
|
"clsx": "^2.1.1",
|
|
39
28
|
"cmdk": "^1.1.1",
|
|
40
29
|
"date-fns": "^4.1.0",
|
|
41
30
|
"diff": "^9.0.0",
|
|
31
|
+
"lodash-es": "^4.17.21",
|
|
42
32
|
"lucide-react": "^0.544.0",
|
|
33
|
+
"motion": "^13.2.0",
|
|
43
34
|
"react": "^19.2.6",
|
|
44
35
|
"react-day-picker": "^10.0.1",
|
|
45
36
|
"react-dom": "^19.2.6",
|
|
@@ -49,7 +40,6 @@
|
|
|
49
40
|
"recharts": "^3.8.0",
|
|
50
41
|
"remark-gfm": "^4.0.1",
|
|
51
42
|
"shadcn": "^4.19.0",
|
|
52
|
-
"shiki": "^4.4.3",
|
|
53
43
|
"tailwind-merge": "^3.6.0",
|
|
54
44
|
"tw-animate-css": "^1.4.0",
|
|
55
45
|
"zod": "^4.4.3"
|
|
@@ -59,6 +49,13 @@
|
|
|
59
49
|
"react-dom": "^19"
|
|
60
50
|
},
|
|
61
51
|
"devDependencies": {
|
|
52
|
+
"@codemirror/autocomplete": "^6.20.3",
|
|
53
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
54
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
55
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
56
|
+
"@codemirror/lang-markdown": "^6.5.2",
|
|
57
|
+
"@codemirror/language": "^6.12.4",
|
|
58
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
62
59
|
"@eslint/js": "^9",
|
|
63
60
|
"@testing-library/jest-dom": "^6.8.0",
|
|
64
61
|
"@testing-library/react": "^16.3.0",
|
|
@@ -67,9 +64,11 @@
|
|
|
67
64
|
"@types/node": "^24",
|
|
68
65
|
"@types/react": "^19",
|
|
69
66
|
"@types/react-dom": "^19",
|
|
67
|
+
"@uiw/react-codemirror": "^4.25.11",
|
|
70
68
|
"@vitest/coverage-v8": "^3.2.4",
|
|
71
69
|
"eslint": "^9",
|
|
72
70
|
"jsdom": "^26.1.0",
|
|
71
|
+
"shiki": "^4.4.3",
|
|
73
72
|
"tailwindcss": "^4",
|
|
74
73
|
"typescript": "~5.9.2",
|
|
75
74
|
"vite": "^7",
|
|
@@ -97,7 +96,9 @@
|
|
|
97
96
|
"dist",
|
|
98
97
|
"components.json"
|
|
99
98
|
],
|
|
99
|
+
"license": "MIT",
|
|
100
100
|
"publishConfig": {
|
|
101
101
|
"access": "public"
|
|
102
|
-
}
|
|
102
|
+
},
|
|
103
|
+
"description": "Mini-app UI kit + useApp(); iframe bundles runtime.js/sdk.js live in dist/"
|
|
103
104
|
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { StreamLanguage } from "@codemirror/language"
|
|
2
|
-
import type { CompletionContext } from "@codemirror/autocomplete"
|
|
3
|
-
|
|
4
|
-
const KEYWORDS =
|
|
5
|
-
/^(AND|OR|NOT|ORDER|BY|ASC|DESC|IN|IS|EMPTY|NULL|WAS|CHANGED)\b/i
|
|
6
|
-
const OPERATORS = /^(!=|!~|>=|<=|=|~|>|<)/
|
|
7
|
-
|
|
8
|
-
export const jqlLanguage = StreamLanguage.define({
|
|
9
|
-
token(stream) {
|
|
10
|
-
if (stream.eatSpace()) return null
|
|
11
|
-
if (stream.match(/"(?:[^"\\]|\\.)*"/) || stream.match(/'(?:[^'\\]|\\.)*'/)) return "string"
|
|
12
|
-
if (stream.match(/^[0-9]+(\.[0-9]+)?/)) return "number"
|
|
13
|
-
if (stream.match(KEYWORDS)) return "keyword"
|
|
14
|
-
if (stream.match(OPERATORS)) return "operator"
|
|
15
|
-
if (stream.match(/^[(),[\]]/)) return "punctuation"
|
|
16
|
-
if (stream.match(/^[A-Za-z_][A-Za-z0-9_]*(?=\s*\()/)) return "function"
|
|
17
|
-
if (stream.match(/^[A-Za-z][A-Za-z0-9_.]*/)) return "variableName"
|
|
18
|
-
stream.next()
|
|
19
|
-
return null
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export type JqlSuggestItem = { name: string; detail?: string }
|
|
24
|
-
|
|
25
|
-
export function jqlCompletion(fields: JqlSuggestItem[], functions: JqlSuggestItem[]) {
|
|
26
|
-
const keywords = ["AND", "OR", "NOT", "ORDER BY", "ASC", "DESC", "IN", "NOT IN", "IS", "IS NOT", "EMPTY"]
|
|
27
|
-
return (context: CompletionContext) => {
|
|
28
|
-
const word = context.matchBefore(/[A-Za-z_][\w.]*/)
|
|
29
|
-
if (!word && !context.explicit) return null
|
|
30
|
-
return {
|
|
31
|
-
from: word?.from ?? context.pos,
|
|
32
|
-
options: [
|
|
33
|
-
...fields.map((field) => ({
|
|
34
|
-
label: field.name,
|
|
35
|
-
type: "property",
|
|
36
|
-
detail: field.detail,
|
|
37
|
-
})),
|
|
38
|
-
...functions.map((fn) => ({
|
|
39
|
-
label: `${fn.name}()`,
|
|
40
|
-
type: "function",
|
|
41
|
-
detail: fn.detail,
|
|
42
|
-
})),
|
|
43
|
-
...keywords.map((label) => ({ label, type: "keyword" })),
|
|
44
|
-
],
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const defaultJqlFields: JqlSuggestItem[] = [
|
|
50
|
-
{ name: "project", detail: "Project key" },
|
|
51
|
-
{ name: "status", detail: "Status" },
|
|
52
|
-
{ name: "assignee", detail: "Assignee" },
|
|
53
|
-
{ name: "reporter", detail: "Reporter" },
|
|
54
|
-
{ name: "issuetype", detail: "Issue type" },
|
|
55
|
-
{ name: "priority", detail: "Priority" },
|
|
56
|
-
{ name: "labels", detail: "Labels" },
|
|
57
|
-
{ name: "fixVersion", detail: "Fix version" },
|
|
58
|
-
{ name: "created", detail: "Created" },
|
|
59
|
-
{ name: "updated", detail: "Updated" },
|
|
60
|
-
{ name: "summary", detail: "Summary" },
|
|
61
|
-
{ name: "key", detail: "Issue key" },
|
|
62
|
-
]
|
|
63
|
-
|
|
64
|
-
export const defaultJqlFunctions: JqlSuggestItem[] = [
|
|
65
|
-
{ name: "currentUser", detail: "Logged-in user" },
|
|
66
|
-
{ name: "now", detail: "Current time" },
|
|
67
|
-
{ name: "startOfDay", detail: "Start of day" },
|
|
68
|
-
{ name: "endOfDay", detail: "End of day" },
|
|
69
|
-
{ name: "membersOf", detail: "Group members" },
|
|
70
|
-
]
|