@homecode/ui 5.20.1 → 5.20.3

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.
@@ -0,0 +1,41 @@
1
+ # Publish to npm from CI with a provenance attestation, so consumers can check
2
+ # which commit and workflow built the tarball (`npm audit signatures`).
3
+ # Runs when a release tag (from `yarn release`) is pushed.
4
+ # One-time: add an NPM_TOKEN repository secret (an automation token from the
5
+ # npm account or org that owns the package).
6
+
7
+ name: Publish to npm
8
+
9
+ on:
10
+ push:
11
+ tags: ['v*']
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+ id-token: write
17
+
18
+ jobs:
19
+ publish:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - uses: actions/setup-node@v4
25
+ with:
26
+ node-version: '22'
27
+ registry-url: 'https://registry.npmjs.org'
28
+ cache: yarn
29
+ cache-dependency-path: yarn.lock
30
+
31
+ - name: Install
32
+ run: yarn install --frozen-lockfile
33
+
34
+
35
+ - name: Build
36
+ run: yarn build
37
+
38
+ - name: Publish
39
+ run: npm publish --provenance --access public
40
+ env:
41
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -82,15 +82,27 @@ function NestedMenuComponent({ trigger, items, open, onOpenChange, align = 'end'
82
82
  }
83
83
  function renderItemButton(item) {
84
84
  return (jsxs("button", { type: "button", className: cn(S.item, activeId === item.id && S.itemActive, item.danger && S.itemDanger, item.disabled && S.itemDisabled, item.wrap && S.wrap, item.className), role: "menuitem", disabled: item.disabled, "aria-haspopup": item.submenu ? 'menu' : undefined, "aria-expanded": item.submenu ? activeId === item.id : undefined, onPointerDown: e => {
85
+ // Touch/pen are handled on click: acting on pointerdown opens a
86
+ // Dialog under the finger, and the synthesized click then lands on
87
+ // its overlay and closes it immediately.
88
+ if (e.button === 0 && e.pointerType === 'mouse') {
89
+ handleItemClick(item.id, e);
90
+ }
85
91
  // Keep focus off underlying inputs (e.g. ChatSelector search).
92
+ // After the handler: it reads `defaultPrevented` to let an item's
93
+ // onClick keep the menu open.
86
94
  e.preventDefault();
87
- if (e.button === 0)
88
- handleItemClick(item.id, e);
95
+ }, onClick: e => {
96
+ // Mouse is handled on pointerdown; keyboard on keydown (detail 0).
97
+ const { pointerType } = e.nativeEvent;
98
+ if (e.detail === 0 || pointerType === 'mouse')
99
+ return;
100
+ handleItemClick(item.id, e);
89
101
  }, onKeyDown: e => {
90
102
  if (e.key !== 'Enter' && e.key !== ' ')
91
103
  return;
92
- e.preventDefault();
93
104
  handleItemClick(item.id, e);
105
+ e.preventDefault();
94
106
  }, children: [item.icon && (jsx("span", { className: S.icon, "aria-hidden": true, children: item.icon })), item.hint != null && item.hint !== '' ? (jsxs("span", { className: S.text, children: [jsx("span", { className: S.label, children: item.label }), jsx("span", { className: S.hint, children: item.hint })] })) : (jsx("span", { className: S.label, children: item.label })), item.submenu && (jsx(Icon, { className: S.chevron, type: "chevronRight", size: iconSize }))] }));
95
107
  }
96
108
  function renderItems() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homecode/ui",
3
- "version": "5.20.1",
3
+ "version": "5.20.3",
4
4
  "description": "React UI components library",
5
5
  "scripts": {
6
6
  "tests": "jest",
@@ -35,7 +35,7 @@
35
35
  "homepage": "https://uilib.apostol.space",
36
36
  "repository": {
37
37
  "type": "git",
38
- "url": "git+https://github.com/foreverido/uilib.git"
38
+ "url": "git+https://github.com/homecodeorg/ui.git"
39
39
  },
40
40
  "main": "./dist/esm/index.js",
41
41
  "module": "dist/esm",
@@ -59,30 +59,21 @@
59
59
  "dist": "./dist"
60
60
  },
61
61
  "dependencies": {
62
- "@homecode/ui": "^4.17.2",
63
- "@rollup/plugin-typescript": "^11.0.0",
64
- "@tiptap/core": "^3.22.1",
65
- "@tiptap/extension-mention": "^3.22.1",
66
- "@tiptap/extensions": "^3.22.1",
67
- "@tiptap/pm": "^3.22.1",
68
- "@tiptap/react": "^3.22.1",
69
- "@tiptap/starter-kit": "^3.22.1",
70
- "@tiptap/suggestion": "^3.22.1",
62
+ "@tiptap/core": "^3.30.5",
63
+ "@tiptap/extension-mention": "^3.30.5",
64
+ "@tiptap/extensions": "^3.30.5",
65
+ "@tiptap/pm": "^3.30.5",
66
+ "@tiptap/react": "^3.30.5",
67
+ "@tiptap/starter-kit": "^3.30.5",
68
+ "@tiptap/suggestion": "^3.30.5",
71
69
  "classnames": "^2.3.2",
72
- "compareq": "^1.2.2",
70
+ "compareq": "^1.2.3",
73
71
  "fastest-validator": "^1.16.0",
74
- "favicons": "^7.1.3",
75
- "justorm": "^3.0.2",
72
+ "justorm": "^3.0.3",
76
73
  "linkifyjs": "^4.3.3",
77
- "lucide-react": "^1.43.0",
78
- "moment": "^2.29.4",
79
- "react": "^18.2.0",
80
- "react-dom": "^18.2.0",
81
- "react-live": "^3.1.2",
74
+ "moment": "^2.31.0",
75
+ "nanoid": "^3.3.18",
82
76
  "roddeh-i18n": "^1.2.1",
83
- "rollup-plugin-postcss": "^4.0.2",
84
- "rollup-plugin-uglify": "^6.0.4",
85
- "svgo": "^3.0.2",
86
77
  "timen": "^0.1.0"
87
78
  },
88
79
  "peerDependencies": {
@@ -96,6 +87,7 @@
96
87
  "@rollup/plugin-commonjs": "^24.0.1",
97
88
  "@rollup/plugin-json": "^6.0.0",
98
89
  "@rollup/plugin-node-resolve": "^15.0.1",
90
+ "@rollup/plugin-typescript": "^11.0.0",
99
91
  "@svgr/rollup": "^6.5.1",
100
92
  "@testing-library/dom": "^10.4.0",
101
93
  "@testing-library/jest-dom": "^6.5.0",
@@ -107,21 +99,29 @@
107
99
  "@types/react-dom": "^18.3.5",
108
100
  "@vitejs/plugin-react-swc": "^3.11.0",
109
101
  "babel-jest": "^29.7.0",
102
+ "favicons": "^7.1.3",
110
103
  "fs": "^0.0.2",
111
104
  "identity-obj-proxy": "^3.0.0",
112
105
  "jest": "^29.7.0",
113
106
  "jest-environment-jsdom": "^29.7.0",
107
+ "lucide-react": "^1.43.0",
114
108
  "postcss-preset-env": "^8.0.1",
115
109
  "raw-loader": "^4.0.2",
110
+ "react": "^18.2.0",
111
+ "react-dom": "^18.2.0",
112
+ "react-live": "^3.1.2",
116
113
  "replace": "^1.2.2",
117
114
  "rollup": "^3.17.1",
118
115
  "rollup-plugin-delete": "^2.0.0",
119
116
  "rollup-plugin-dts": "^5.2.0",
120
117
  "rollup-plugin-node-externals": "^5.1.2",
118
+ "rollup-plugin-postcss": "^4.0.2",
121
119
  "rollup-plugin-styles": "^4.0.0",
122
120
  "rollup-plugin-typescript2": "^0.37.0",
121
+ "rollup-plugin-uglify": "^6.0.4",
123
122
  "standard-version": "^9.5.0",
124
123
  "stylus": "^0.59.0",
124
+ "svgo": "^3.0.2",
125
125
  "ts-jest": "^29.2.5",
126
126
  "ts-to-json": "^1.22.11",
127
127
  "typescript": "^4.9.5",