@monkey-mini-app/ui 0.1.0 → 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.
Files changed (203) hide show
  1. package/README.md +58 -0
  2. package/dist/globals.css +1 -1
  3. package/dist/index.js +12 -2
  4. package/dist/manifest.json +6 -6
  5. package/dist/runtime.js +9 -0
  6. package/dist/sdk.js +158 -0
  7. package/dist/src/blocks/activity-feed.tsx +7 -0
  8. package/dist/src/blocks/app-shell.tsx +1 -0
  9. package/dist/src/blocks/attachment-gallery.tsx +7 -0
  10. package/dist/src/blocks/bar-chart.tsx +15 -1
  11. package/dist/src/blocks/comment-thread.tsx +7 -0
  12. package/dist/src/blocks/dashboard-shell.tsx +109 -0
  13. package/dist/src/blocks/description-list.tsx +7 -0
  14. package/dist/src/blocks/detail-panel.tsx +1 -0
  15. package/dist/src/blocks/donut-chart.tsx +19 -2
  16. package/dist/src/blocks/env-badge.tsx +7 -0
  17. package/dist/src/blocks/env-table.tsx +316 -0
  18. package/dist/src/blocks/file-tree.tsx +7 -0
  19. package/dist/src/blocks/filter-bar.tsx +1 -0
  20. package/dist/src/blocks/form-sheet.tsx +160 -0
  21. package/dist/src/blocks/gauge.tsx +29 -6
  22. package/dist/src/blocks/list-detail.tsx +121 -0
  23. package/dist/src/blocks/notification-center.tsx +7 -0
  24. package/dist/src/blocks/page-header.tsx +1 -0
  25. package/dist/src/blocks/progress-ring.tsx +20 -2
  26. package/dist/src/blocks/radar-chart.tsx +18 -1
  27. package/dist/src/blocks/request-inspector.tsx +7 -0
  28. package/dist/src/blocks/reveal.tsx +56 -0
  29. package/dist/src/blocks/run-timeline.tsx +7 -0
  30. package/dist/src/blocks/scrollspy.tsx +7 -0
  31. package/dist/src/blocks/settings-split.tsx +154 -0
  32. package/dist/src/blocks/severity-chip.tsx +7 -0
  33. package/dist/src/blocks/sparkline.tsx +12 -3
  34. package/dist/src/blocks/stat-card.tsx +1 -0
  35. package/dist/src/blocks/status-badge.tsx +1 -0
  36. package/dist/src/blocks/table-page.tsx +83 -0
  37. package/dist/src/blocks/terminal.tsx +21 -3
  38. package/dist/src/blocks/test-step-list.tsx +7 -0
  39. package/dist/src/blocks/trend-card.tsx +7 -0
  40. package/dist/src/blocks/wizard-shell.tsx +132 -0
  41. package/dist/src/cdn-modules.d.ts +5 -0
  42. package/dist/src/components/accordion.tsx +7 -0
  43. package/dist/src/components/alert-dialog.tsx +7 -0
  44. package/dist/src/components/alert.tsx +7 -0
  45. package/dist/src/components/aspect-ratio.tsx +4 -0
  46. package/dist/src/components/attachment.tsx +4 -0
  47. package/dist/src/components/avatar.tsx +4 -0
  48. package/dist/src/components/badge.tsx +7 -0
  49. package/dist/src/components/breadcrumb.tsx +4 -0
  50. package/dist/src/components/bubble.tsx +4 -0
  51. package/dist/src/components/button-group.tsx +6 -0
  52. package/dist/src/components/button.tsx +7 -0
  53. package/dist/src/components/calendar.tsx +4 -0
  54. package/dist/src/components/card.tsx +8 -1
  55. package/dist/src/components/chart.tsx +7 -0
  56. package/dist/src/components/checkbox.tsx +5 -0
  57. package/dist/src/components/collapsible.tsx +4 -0
  58. package/dist/src/components/combobox.tsx +4 -0
  59. package/dist/src/components/command.tsx +6 -0
  60. package/dist/src/components/context-menu.tsx +4 -0
  61. package/dist/src/components/dialog.tsx +21 -0
  62. package/dist/src/components/drawer.tsx +4 -0
  63. package/dist/src/components/dropdown-menu.tsx +7 -0
  64. package/dist/src/components/empty.tsx +7 -0
  65. package/dist/src/components/field.tsx +6 -0
  66. package/dist/src/components/hover-card.tsx +4 -0
  67. package/dist/src/components/input-group.tsx +4 -0
  68. package/dist/src/components/input.tsx +7 -0
  69. package/dist/src/components/item.tsx +4 -0
  70. package/dist/src/components/kbd.tsx +4 -0
  71. package/dist/src/components/label.tsx +7 -0
  72. package/dist/src/components/marker.tsx +4 -0
  73. package/dist/src/components/menubar.tsx +4 -0
  74. package/dist/src/components/message-scroller.tsx +4 -0
  75. package/dist/src/components/message.tsx +4 -0
  76. package/dist/src/components/native-select.tsx +4 -0
  77. package/dist/src/components/navigation-menu.tsx +4 -0
  78. package/dist/src/components/pagination.tsx +4 -0
  79. package/dist/src/components/popover.tsx +7 -0
  80. package/dist/src/components/progress.tsx +7 -0
  81. package/dist/src/components/questionnaire.tsx +4 -0
  82. package/dist/src/components/radio-group.tsx +4 -0
  83. package/dist/src/components/resizable.tsx +7 -0
  84. package/dist/src/components/scroll-area.tsx +4 -0
  85. package/dist/src/components/select.tsx +7 -0
  86. package/dist/src/components/separator.tsx +5 -0
  87. package/dist/src/components/sheet.tsx +22 -0
  88. package/dist/src/components/sidebar.tsx +4 -0
  89. package/dist/src/components/skeleton.tsx +7 -0
  90. package/dist/src/components/slider.tsx +4 -0
  91. package/dist/src/components/spinner.tsx +6 -0
  92. package/dist/src/components/switch.tsx +7 -0
  93. package/dist/src/components/table.tsx +7 -0
  94. package/dist/src/components/tabs.tsx +7 -0
  95. package/dist/src/components/textarea.tsx +7 -0
  96. package/dist/src/components/toast.tsx +7 -0
  97. package/dist/src/components/toggle-group.tsx +4 -0
  98. package/dist/src/components/toggle.tsx +4 -0
  99. package/dist/src/components/tooltip.tsx +7 -0
  100. package/dist/src/composites/autocomplete.tsx +7 -0
  101. package/dist/src/composites/cascader.tsx +7 -0
  102. package/dist/src/composites/color-picker.tsx +7 -0
  103. package/dist/src/composites/confirm-dialog.tsx +7 -0
  104. package/dist/src/composites/copyable.tsx +9 -1
  105. package/dist/src/composites/currency-input.tsx +7 -0
  106. package/dist/src/composites/date-picker.tsx +7 -0
  107. package/dist/src/composites/date-range-picker.tsx +4 -0
  108. package/dist/src/composites/date-time-picker.tsx +7 -0
  109. package/dist/src/composites/date-time-range-picker.tsx +7 -0
  110. package/dist/src/composites/duration-input.tsx +7 -0
  111. package/dist/src/composites/mini-calendar.tsx +7 -0
  112. package/dist/src/composites/number-field.tsx +7 -0
  113. package/dist/src/composites/password-field.tsx +7 -0
  114. package/dist/src/composites/phone-input.tsx +7 -0
  115. package/dist/src/composites/rating.tsx +7 -0
  116. package/dist/src/composites/relative-date-picker.tsx +7 -0
  117. package/dist/src/composites/search-input.tsx +7 -0
  118. package/dist/src/composites/slider-range.tsx +7 -0
  119. package/dist/src/composites/tag-input.tsx +7 -0
  120. package/dist/src/composites/time-picker.tsx +11 -1
  121. package/dist/src/composites/time-range-picker.tsx +7 -0
  122. package/dist/src/composites/timezone-select.tsx +7 -0
  123. package/dist/src/composites/transfer.tsx +7 -0
  124. package/dist/src/composites/user-picker.tsx +7 -0
  125. package/dist/src/hooks/use-html-dark.ts +37 -0
  126. package/dist/src/hooks/use-mobile.ts +3 -0
  127. package/dist/src/i18n/en.ts +109 -2
  128. package/dist/src/i18n/zh.ts +99 -2
  129. package/dist/src/index.ts +147 -134
  130. package/dist/src/lib/clipboard.ts +10 -0
  131. package/dist/src/lib/illustrations.tsx +2 -2
  132. package/dist/src/products/code-block.tsx +35 -18
  133. package/dist/src/products/code-editor.tsx +156 -24
  134. package/dist/src/products/commit-graph.tsx +644 -0
  135. package/dist/src/products/data-grid.tsx +2 -1
  136. package/dist/src/products/diff-viewer.tsx +104 -8
  137. package/dist/src/products/event-calendar.tsx +28 -823
  138. package/dist/src/products/file-dropzone.tsx +7 -0
  139. package/dist/src/products/full-calendar/animations.ts +38 -0
  140. package/dist/src/products/full-calendar/calendar-body.tsx +77 -0
  141. package/dist/src/products/full-calendar/constants.ts +10 -0
  142. package/dist/src/products/full-calendar/contexts/calendar-context.tsx +255 -0
  143. package/dist/src/products/full-calendar/contexts/dnd-context.tsx +157 -0
  144. package/dist/src/products/full-calendar/dialogs/add-edit-event-dialog.tsx +187 -0
  145. package/dist/src/products/full-calendar/dialogs/delete-event-dialog.tsx +39 -0
  146. package/dist/src/products/full-calendar/dialogs/event-details-dialog.tsx +100 -0
  147. package/dist/src/products/full-calendar/dialogs/events-list-dialog.tsx +87 -0
  148. package/dist/src/products/full-calendar/dnd/draggable-event.tsx +45 -0
  149. package/dist/src/products/full-calendar/dnd/droppable-area.tsx +45 -0
  150. package/dist/src/products/full-calendar/dnd/resizable-event.tsx +179 -0
  151. package/dist/src/products/full-calendar/header/calendar-header.tsx +65 -0
  152. package/dist/src/products/full-calendar/header/date-navigator.tsx +110 -0
  153. package/dist/src/products/full-calendar/header/filter.tsx +58 -0
  154. package/dist/src/products/full-calendar/header/today-button.tsx +45 -0
  155. package/dist/src/products/full-calendar/header/user-select.tsx +64 -0
  156. package/dist/src/products/full-calendar/header/view-tabs.tsx +36 -0
  157. package/dist/src/products/full-calendar/helpers.ts +453 -0
  158. package/dist/src/products/full-calendar/hooks/use-time-range-create.ts +152 -0
  159. package/dist/src/products/full-calendar/hooks.ts +70 -0
  160. package/dist/src/products/full-calendar/interfaces.ts +23 -0
  161. package/dist/src/products/full-calendar/settings/settings.tsx +80 -0
  162. package/dist/src/products/full-calendar/shims/avatar-group.tsx +16 -0
  163. package/dist/src/products/full-calendar/shims/day-picker.tsx +1 -0
  164. package/dist/src/products/full-calendar/shims/motion.tsx +97 -0
  165. package/dist/src/products/full-calendar/shims/next-themes.ts +6 -0
  166. package/dist/src/products/full-calendar/shims/re-resizable.tsx +25 -0
  167. package/dist/src/products/full-calendar/shims/sonner.ts +4 -0
  168. package/dist/src/products/full-calendar/types.ts +8 -0
  169. package/dist/src/products/full-calendar/views/agenda-view/agenda-events.tsx +140 -0
  170. package/dist/src/products/full-calendar/views/month-view/calendar-month-view.tsx +69 -0
  171. package/dist/src/products/full-calendar/views/month-view/day-cell.tsx +201 -0
  172. package/dist/src/products/full-calendar/views/month-view/event-bullet.tsx +40 -0
  173. package/dist/src/products/full-calendar/views/month-view/month-event-badge.tsx +143 -0
  174. package/dist/src/products/full-calendar/views/week-and-day-view/calendar-day-view.tsx +295 -0
  175. package/dist/src/products/full-calendar/views/week-and-day-view/calendar-time-line.tsx +35 -0
  176. package/dist/src/products/full-calendar/views/week-and-day-view/calendar-week-view.tsx +253 -0
  177. package/dist/src/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.tsx +73 -0
  178. package/dist/src/products/full-calendar/views/week-and-day-view/event-block.tsx +114 -0
  179. package/dist/src/products/full-calendar/views/week-and-day-view/render-grouped-events.tsx +49 -0
  180. package/dist/src/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.tsx +143 -0
  181. package/dist/src/products/full-calendar/views/year-view/calendar-year-view.tsx +161 -0
  182. package/dist/src/products/gantt.tsx +7 -0
  183. package/dist/src/products/jira-wiki.tsx +1 -0
  184. package/dist/src/products/jql-input.tsx +340 -37
  185. package/dist/src/products/json-viewer.tsx +7 -0
  186. package/dist/src/products/kanban-issue-panel.tsx +7 -0
  187. package/dist/src/products/kanban.tsx +1 -0
  188. package/dist/src/products/log-viewer.tsx +390 -18
  189. package/dist/src/products/markdown-editor.tsx +21 -6
  190. package/dist/src/products/markdown.tsx +7 -0
  191. package/dist/src/products/rich-text-editor.tsx +65 -59
  192. package/dist/src/products/sortable-list.tsx +7 -0
  193. package/dist/src/products/stepper.tsx +219 -70
  194. package/dist/src/products/timeline.tsx +7 -0
  195. package/dist/src/products/tree-view.tsx +7 -0
  196. package/dist/src/sdk/app-error-boundary.tsx +240 -0
  197. package/dist/src/sdk/app-id.ts +7 -0
  198. package/dist/src/sdk/use-app.ts +126 -0
  199. package/dist/src/styles/globals.css +7 -7
  200. package/dist/vendors/lodash.js +20 -0
  201. package/dist/vendors/motion.js +12 -0
  202. package/package.json +23 -19
  203. 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.0",
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
- "skill:gen": "node ../../scripts/generate-skill.mjs",
12
- "build:dist": "node ../../scripts/build-ui.mjs",
13
- "build": "node ../../scripts/build-ui.mjs",
14
- "prepack": "node ../../scripts/build-ui.mjs"
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",
@@ -96,5 +95,10 @@
96
95
  "files": [
97
96
  "dist",
98
97
  "components.json"
99
- ]
98
+ ],
99
+ "license": "MIT",
100
+ "publishConfig": {
101
+ "access": "public"
102
+ },
103
+ "description": "Mini-app UI kit + useApp(); iframe bundles runtime.js/sdk.js live in dist/"
100
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
- ]