@hanzogui/context-menu 7.0.0 → 7.3.1
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/dist/cjs/ContextMenu.cjs +185 -0
- package/dist/cjs/ContextMenu.native.js +193 -0
- package/dist/cjs/ContextMenu.native.js.map +1 -0
- package/dist/cjs/createNonNativeContextMenu.cjs +443 -0
- package/dist/cjs/createNonNativeContextMenu.native.js +470 -0
- package/dist/cjs/createNonNativeContextMenu.native.js.map +1 -0
- package/dist/cjs/index.cjs +41 -0
- package/dist/cjs/index.native.js +44 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/esm/ContextMenu.mjs +149 -0
- package/dist/esm/ContextMenu.mjs.map +1 -0
- package/dist/esm/ContextMenu.native.js +154 -0
- package/dist/esm/ContextMenu.native.js.map +1 -0
- package/dist/esm/createNonNativeContextMenu.mjs +406 -0
- package/dist/esm/createNonNativeContextMenu.mjs.map +1 -0
- package/dist/esm/createNonNativeContextMenu.native.js +430 -0
- package/dist/esm/createNonNativeContextMenu.native.js.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +15 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +15 -0
- package/dist/esm/index.native.js.map +1 -0
- package/dist/jsx/ContextMenu.mjs +149 -0
- package/dist/jsx/ContextMenu.mjs.map +1 -0
- package/dist/jsx/ContextMenu.native.js +193 -0
- package/dist/jsx/ContextMenu.native.js.map +1 -0
- package/dist/jsx/createNonNativeContextMenu.mjs +406 -0
- package/dist/jsx/createNonNativeContextMenu.mjs.map +1 -0
- package/dist/jsx/createNonNativeContextMenu.native.js +470 -0
- package/dist/jsx/createNonNativeContextMenu.native.js.map +1 -0
- package/dist/jsx/index.js +15 -0
- package/dist/jsx/index.js.map +1 -0
- package/dist/jsx/index.mjs +15 -0
- package/dist/jsx/index.mjs.map +1 -0
- package/dist/jsx/index.native.js +44 -0
- package/dist/jsx/index.native.js.map +1 -0
- package/package.json +15 -13
- package/src/createNonNativeContextMenu.tsx +17 -17
- package/types/ContextMenu.d.ts +26 -26
- package/types/ContextMenu.d.ts.map +1 -0
- package/types/createNonNativeContextMenu.d.ts +41 -41
- package/types/createNonNativeContextMenu.d.ts.map +1 -0
- package/types/index.d.ts +26 -26
- package/types/index.d.ts.map +1 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
+
get: () => from[key],
|
|
17
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
34
|
+
var ContextMenu_exports = {};
|
|
35
|
+
__export(ContextMenu_exports, {
|
|
36
|
+
createContextMenu: () => createContextMenu
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(ContextMenu_exports);
|
|
39
|
+
var import_create_menu = require("@hanzogui/create-menu");
|
|
40
|
+
var import_web = require("@hanzogui/web");
|
|
41
|
+
var import_react = __toESM(require("react"), 1);
|
|
42
|
+
var import_createNonNativeContextMenu = require("./createNonNativeContextMenu.cjs");
|
|
43
|
+
const COMMON_PARAMS = {
|
|
44
|
+
isRoot: false,
|
|
45
|
+
scope: import_createNonNativeContextMenu.CONTEXTMENU_CONTEXT
|
|
46
|
+
};
|
|
47
|
+
function createContextMenu(param) {
|
|
48
|
+
const {
|
|
49
|
+
Menu: NativeMenuRoot
|
|
50
|
+
} = (0, import_create_menu.createNativeMenu)("ContextMenu");
|
|
51
|
+
const NonNativeContextMenu = (0, import_createNonNativeContextMenu.createNonNativeContextMenu)(param);
|
|
52
|
+
const ContextMenuComp = (0, import_create_menu.withNativeMenu)({
|
|
53
|
+
...COMMON_PARAMS,
|
|
54
|
+
Component: NonNativeContextMenu.Root,
|
|
55
|
+
NativeComponent: NativeMenuRoot,
|
|
56
|
+
isRoot: true
|
|
57
|
+
});
|
|
58
|
+
const Trigger = (0, import_create_menu.withNativeMenu)({
|
|
59
|
+
...COMMON_PARAMS,
|
|
60
|
+
Component: NonNativeContextMenu.Trigger,
|
|
61
|
+
NativeComponent: NativeMenuRoot.Trigger
|
|
62
|
+
});
|
|
63
|
+
const Portal = (0, import_create_menu.withNativeMenu)({
|
|
64
|
+
...COMMON_PARAMS,
|
|
65
|
+
Component: NonNativeContextMenu.Portal,
|
|
66
|
+
NativeComponent: import_react.default.Fragment
|
|
67
|
+
});
|
|
68
|
+
const Content = (0, import_create_menu.withNativeMenu)({
|
|
69
|
+
...COMMON_PARAMS,
|
|
70
|
+
Component: NonNativeContextMenu.Content,
|
|
71
|
+
NativeComponent: NativeMenuRoot.Content
|
|
72
|
+
});
|
|
73
|
+
const Preview = (0, import_create_menu.withNativeMenu)({
|
|
74
|
+
...COMMON_PARAMS,
|
|
75
|
+
Component: NonNativeContextMenu.Preview,
|
|
76
|
+
NativeComponent: NativeMenuRoot.Preview
|
|
77
|
+
});
|
|
78
|
+
const Group = (0, import_create_menu.withNativeMenu)({
|
|
79
|
+
...COMMON_PARAMS,
|
|
80
|
+
Component: NonNativeContextMenu.Group,
|
|
81
|
+
NativeComponent: NativeMenuRoot.Group
|
|
82
|
+
});
|
|
83
|
+
const Label = (0, import_create_menu.withNativeMenu)({
|
|
84
|
+
...COMMON_PARAMS,
|
|
85
|
+
Component: NonNativeContextMenu.Label,
|
|
86
|
+
NativeComponent: NativeMenuRoot.Label
|
|
87
|
+
});
|
|
88
|
+
const Item = (0, import_create_menu.withNativeMenu)({
|
|
89
|
+
...COMMON_PARAMS,
|
|
90
|
+
Component: NonNativeContextMenu.Item,
|
|
91
|
+
NativeComponent: NativeMenuRoot.Item
|
|
92
|
+
});
|
|
93
|
+
const ItemTitle = (0, import_create_menu.withNativeMenu)({
|
|
94
|
+
...COMMON_PARAMS,
|
|
95
|
+
Component: NonNativeContextMenu.ItemTitle,
|
|
96
|
+
NativeComponent: NativeMenuRoot.ItemTitle
|
|
97
|
+
});
|
|
98
|
+
const ItemSubtitle = (0, import_create_menu.withNativeMenu)({
|
|
99
|
+
...COMMON_PARAMS,
|
|
100
|
+
Component: NonNativeContextMenu.ItemSubtitle,
|
|
101
|
+
NativeComponent: NativeMenuRoot.ItemSubtitle
|
|
102
|
+
});
|
|
103
|
+
const ItemIcon = (0, import_create_menu.withNativeMenu)({
|
|
104
|
+
...COMMON_PARAMS,
|
|
105
|
+
Component: NonNativeContextMenu.ItemIcon,
|
|
106
|
+
NativeComponent: NativeMenuRoot.ItemIcon
|
|
107
|
+
});
|
|
108
|
+
const ItemImage = (0, import_create_menu.withNativeMenu)({
|
|
109
|
+
...COMMON_PARAMS,
|
|
110
|
+
Component: NonNativeContextMenu.ItemImage,
|
|
111
|
+
NativeComponent: NativeMenuRoot.ItemImage
|
|
112
|
+
});
|
|
113
|
+
const CheckboxItem = (0, import_create_menu.withNativeMenu)({
|
|
114
|
+
...COMMON_PARAMS,
|
|
115
|
+
Component: NonNativeContextMenu.CheckboxItem,
|
|
116
|
+
NativeComponent: NativeMenuRoot.CheckboxItem
|
|
117
|
+
});
|
|
118
|
+
const RadioGroup = (0, import_create_menu.withNativeMenu)({
|
|
119
|
+
...COMMON_PARAMS,
|
|
120
|
+
Component: NonNativeContextMenu.RadioGroup,
|
|
121
|
+
NativeComponent: () => null
|
|
122
|
+
});
|
|
123
|
+
const RadioItem = (0, import_create_menu.withNativeMenu)({
|
|
124
|
+
...COMMON_PARAMS,
|
|
125
|
+
Component: NonNativeContextMenu.RadioItem,
|
|
126
|
+
NativeComponent: ({
|
|
127
|
+
children
|
|
128
|
+
}) => children
|
|
129
|
+
});
|
|
130
|
+
const ItemIndicator = (0, import_create_menu.withNativeMenu)({
|
|
131
|
+
...COMMON_PARAMS,
|
|
132
|
+
Component: NonNativeContextMenu.ItemIndicator,
|
|
133
|
+
NativeComponent: NativeMenuRoot.ItemIndicator
|
|
134
|
+
});
|
|
135
|
+
const Separator = (0, import_create_menu.withNativeMenu)({
|
|
136
|
+
...COMMON_PARAMS,
|
|
137
|
+
Component: NonNativeContextMenu.Separator,
|
|
138
|
+
NativeComponent: NativeMenuRoot.Separator
|
|
139
|
+
});
|
|
140
|
+
const Arrow = (0, import_create_menu.withNativeMenu)({
|
|
141
|
+
...COMMON_PARAMS,
|
|
142
|
+
Component: NonNativeContextMenu.Arrow,
|
|
143
|
+
NativeComponent: NativeMenuRoot.Arrow
|
|
144
|
+
});
|
|
145
|
+
const Sub = (0, import_create_menu.withNativeMenu)({
|
|
146
|
+
...COMMON_PARAMS,
|
|
147
|
+
Component: NonNativeContextMenu.Sub,
|
|
148
|
+
NativeComponent: NativeMenuRoot.Sub
|
|
149
|
+
});
|
|
150
|
+
const SubTrigger = (0, import_create_menu.withNativeMenu)({
|
|
151
|
+
...COMMON_PARAMS,
|
|
152
|
+
Component: NonNativeContextMenu.SubTrigger,
|
|
153
|
+
NativeComponent: NativeMenuRoot.SubTrigger
|
|
154
|
+
});
|
|
155
|
+
const SubContent = (0, import_create_menu.withNativeMenu)({
|
|
156
|
+
...COMMON_PARAMS,
|
|
157
|
+
Component: NonNativeContextMenu.SubContent,
|
|
158
|
+
NativeComponent: NativeMenuRoot.SubContent
|
|
159
|
+
});
|
|
160
|
+
const ContextMenu = (0, import_web.withStaticProperties)(ContextMenuComp, {
|
|
161
|
+
Trigger,
|
|
162
|
+
Portal,
|
|
163
|
+
Content,
|
|
164
|
+
Group,
|
|
165
|
+
Label,
|
|
166
|
+
Item,
|
|
167
|
+
CheckboxItem,
|
|
168
|
+
RadioGroup,
|
|
169
|
+
RadioItem,
|
|
170
|
+
ItemIndicator,
|
|
171
|
+
Separator,
|
|
172
|
+
Arrow,
|
|
173
|
+
Sub,
|
|
174
|
+
// cast to React.FC to avoid TS error
|
|
175
|
+
SubTrigger,
|
|
176
|
+
SubContent,
|
|
177
|
+
ItemTitle,
|
|
178
|
+
ItemSubtitle,
|
|
179
|
+
// cast to React.FC to avoid TS error
|
|
180
|
+
ItemIcon,
|
|
181
|
+
ItemImage,
|
|
182
|
+
Preview
|
|
183
|
+
});
|
|
184
|
+
return ContextMenu;
|
|
185
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
+
value: mod,
|
|
31
|
+
enumerable: true
|
|
32
|
+
}) : target, mod));
|
|
33
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
+
value: true
|
|
35
|
+
}), mod);
|
|
36
|
+
var ContextMenu_exports = {};
|
|
37
|
+
__export(ContextMenu_exports, {
|
|
38
|
+
createContextMenu: () => createContextMenu
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(ContextMenu_exports);
|
|
41
|
+
var import_create_menu = require("@hanzogui/create-menu");
|
|
42
|
+
var import_web = require("@hanzogui/web");
|
|
43
|
+
var import_react = __toESM(require("react"), 1);
|
|
44
|
+
var import_createNonNativeContextMenu = require("./createNonNativeContextMenu.native.js");
|
|
45
|
+
var COMMON_PARAMS = {
|
|
46
|
+
isRoot: false,
|
|
47
|
+
scope: import_createNonNativeContextMenu.CONTEXTMENU_CONTEXT
|
|
48
|
+
};
|
|
49
|
+
function createContextMenu(param) {
|
|
50
|
+
var {
|
|
51
|
+
Menu: NativeMenuRoot
|
|
52
|
+
} = (0, import_create_menu.createNativeMenu)("ContextMenu");
|
|
53
|
+
var NonNativeContextMenu = (0, import_createNonNativeContextMenu.createNonNativeContextMenu)(param);
|
|
54
|
+
var ContextMenuComp = (0, import_create_menu.withNativeMenu)({
|
|
55
|
+
...COMMON_PARAMS,
|
|
56
|
+
Component: NonNativeContextMenu.Root,
|
|
57
|
+
NativeComponent: NativeMenuRoot,
|
|
58
|
+
isRoot: true
|
|
59
|
+
});
|
|
60
|
+
var Trigger = (0, import_create_menu.withNativeMenu)({
|
|
61
|
+
...COMMON_PARAMS,
|
|
62
|
+
Component: NonNativeContextMenu.Trigger,
|
|
63
|
+
NativeComponent: NativeMenuRoot.Trigger
|
|
64
|
+
});
|
|
65
|
+
var Portal = (0, import_create_menu.withNativeMenu)({
|
|
66
|
+
...COMMON_PARAMS,
|
|
67
|
+
Component: NonNativeContextMenu.Portal,
|
|
68
|
+
NativeComponent: import_react.default.Fragment
|
|
69
|
+
});
|
|
70
|
+
var Content = (0, import_create_menu.withNativeMenu)({
|
|
71
|
+
...COMMON_PARAMS,
|
|
72
|
+
Component: NonNativeContextMenu.Content,
|
|
73
|
+
NativeComponent: NativeMenuRoot.Content
|
|
74
|
+
});
|
|
75
|
+
var Preview = (0, import_create_menu.withNativeMenu)({
|
|
76
|
+
...COMMON_PARAMS,
|
|
77
|
+
Component: NonNativeContextMenu.Preview,
|
|
78
|
+
NativeComponent: NativeMenuRoot.Preview
|
|
79
|
+
});
|
|
80
|
+
var Group = (0, import_create_menu.withNativeMenu)({
|
|
81
|
+
...COMMON_PARAMS,
|
|
82
|
+
Component: NonNativeContextMenu.Group,
|
|
83
|
+
NativeComponent: NativeMenuRoot.Group
|
|
84
|
+
});
|
|
85
|
+
var Label = (0, import_create_menu.withNativeMenu)({
|
|
86
|
+
...COMMON_PARAMS,
|
|
87
|
+
Component: NonNativeContextMenu.Label,
|
|
88
|
+
NativeComponent: NativeMenuRoot.Label
|
|
89
|
+
});
|
|
90
|
+
var Item = (0, import_create_menu.withNativeMenu)({
|
|
91
|
+
...COMMON_PARAMS,
|
|
92
|
+
Component: NonNativeContextMenu.Item,
|
|
93
|
+
NativeComponent: NativeMenuRoot.Item
|
|
94
|
+
});
|
|
95
|
+
var ItemTitle = (0, import_create_menu.withNativeMenu)({
|
|
96
|
+
...COMMON_PARAMS,
|
|
97
|
+
Component: NonNativeContextMenu.ItemTitle,
|
|
98
|
+
NativeComponent: NativeMenuRoot.ItemTitle
|
|
99
|
+
});
|
|
100
|
+
var ItemSubtitle = (0, import_create_menu.withNativeMenu)({
|
|
101
|
+
...COMMON_PARAMS,
|
|
102
|
+
Component: NonNativeContextMenu.ItemSubtitle,
|
|
103
|
+
NativeComponent: NativeMenuRoot.ItemSubtitle
|
|
104
|
+
});
|
|
105
|
+
var ItemIcon = (0, import_create_menu.withNativeMenu)({
|
|
106
|
+
...COMMON_PARAMS,
|
|
107
|
+
Component: NonNativeContextMenu.ItemIcon,
|
|
108
|
+
NativeComponent: NativeMenuRoot.ItemIcon
|
|
109
|
+
});
|
|
110
|
+
var ItemImage = (0, import_create_menu.withNativeMenu)({
|
|
111
|
+
...COMMON_PARAMS,
|
|
112
|
+
Component: NonNativeContextMenu.ItemImage,
|
|
113
|
+
NativeComponent: NativeMenuRoot.ItemImage
|
|
114
|
+
});
|
|
115
|
+
var CheckboxItem = (0, import_create_menu.withNativeMenu)({
|
|
116
|
+
...COMMON_PARAMS,
|
|
117
|
+
Component: NonNativeContextMenu.CheckboxItem,
|
|
118
|
+
NativeComponent: NativeMenuRoot.CheckboxItem
|
|
119
|
+
});
|
|
120
|
+
var RadioGroup = (0, import_create_menu.withNativeMenu)({
|
|
121
|
+
...COMMON_PARAMS,
|
|
122
|
+
Component: NonNativeContextMenu.RadioGroup,
|
|
123
|
+
NativeComponent: function () {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
var RadioItem = (0, import_create_menu.withNativeMenu)({
|
|
128
|
+
...COMMON_PARAMS,
|
|
129
|
+
Component: NonNativeContextMenu.RadioItem,
|
|
130
|
+
NativeComponent: function (param2) {
|
|
131
|
+
var {
|
|
132
|
+
children
|
|
133
|
+
} = param2;
|
|
134
|
+
return children;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
var ItemIndicator = (0, import_create_menu.withNativeMenu)({
|
|
138
|
+
...COMMON_PARAMS,
|
|
139
|
+
Component: NonNativeContextMenu.ItemIndicator,
|
|
140
|
+
NativeComponent: NativeMenuRoot.ItemIndicator
|
|
141
|
+
});
|
|
142
|
+
var Separator = (0, import_create_menu.withNativeMenu)({
|
|
143
|
+
...COMMON_PARAMS,
|
|
144
|
+
Component: NonNativeContextMenu.Separator,
|
|
145
|
+
NativeComponent: NativeMenuRoot.Separator
|
|
146
|
+
});
|
|
147
|
+
var Arrow = (0, import_create_menu.withNativeMenu)({
|
|
148
|
+
...COMMON_PARAMS,
|
|
149
|
+
Component: NonNativeContextMenu.Arrow,
|
|
150
|
+
NativeComponent: NativeMenuRoot.Arrow
|
|
151
|
+
});
|
|
152
|
+
var Sub = (0, import_create_menu.withNativeMenu)({
|
|
153
|
+
...COMMON_PARAMS,
|
|
154
|
+
Component: NonNativeContextMenu.Sub,
|
|
155
|
+
NativeComponent: NativeMenuRoot.Sub
|
|
156
|
+
});
|
|
157
|
+
var SubTrigger = (0, import_create_menu.withNativeMenu)({
|
|
158
|
+
...COMMON_PARAMS,
|
|
159
|
+
Component: NonNativeContextMenu.SubTrigger,
|
|
160
|
+
NativeComponent: NativeMenuRoot.SubTrigger
|
|
161
|
+
});
|
|
162
|
+
var SubContent = (0, import_create_menu.withNativeMenu)({
|
|
163
|
+
...COMMON_PARAMS,
|
|
164
|
+
Component: NonNativeContextMenu.SubContent,
|
|
165
|
+
NativeComponent: NativeMenuRoot.SubContent
|
|
166
|
+
});
|
|
167
|
+
var ContextMenu = (0, import_web.withStaticProperties)(ContextMenuComp, {
|
|
168
|
+
Trigger,
|
|
169
|
+
Portal,
|
|
170
|
+
Content,
|
|
171
|
+
Group,
|
|
172
|
+
Label,
|
|
173
|
+
Item,
|
|
174
|
+
CheckboxItem,
|
|
175
|
+
RadioGroup,
|
|
176
|
+
RadioItem,
|
|
177
|
+
ItemIndicator,
|
|
178
|
+
Separator,
|
|
179
|
+
Arrow,
|
|
180
|
+
Sub,
|
|
181
|
+
// cast to React.FC to avoid TS error
|
|
182
|
+
SubTrigger,
|
|
183
|
+
SubContent,
|
|
184
|
+
ItemTitle,
|
|
185
|
+
ItemSubtitle,
|
|
186
|
+
// cast to React.FC to avoid TS error
|
|
187
|
+
ItemIcon,
|
|
188
|
+
ItemImage,
|
|
189
|
+
Preview
|
|
190
|
+
});
|
|
191
|
+
return ContextMenu;
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=ContextMenu.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","ContextMenu_exports","createContextMenu","module","exports","import_create_menu","require","import_web","import_react","import_createNonNativeContextMenu","COMMON_PARAMS","isRoot","scope","CONTEXTMENU_CONTEXT","param","Menu","NativeMenuRoot","createNativeMenu","NonNativeContextMenu","createNonNativeContextMenu","ContextMenuComp","withNativeMenu","Component","Root","NativeComponent","Trigger","Portal","default","Fragment","Content","Preview","Group","Label","Item","ItemTitle","ItemSubtitle","ItemIcon","ItemImage","CheckboxItem","RadioGroup","RadioItem","param2","children","ItemIndicator","Separator","Arrow","Sub","SubTrigger","SubContent","ContextMenu","withStaticProperties"],"sources":["ContextMenu.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ContextMenu_exports = {};\n__export(ContextMenu_exports, {\n createContextMenu: () => createContextMenu\n});\nmodule.exports = __toCommonJS(ContextMenu_exports);\nvar import_create_menu = require(\"@hanzogui/create-menu\");\nvar import_web = require(\"@hanzogui/web\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_createNonNativeContextMenu = require(\"./createNonNativeContextMenu\");\nvar COMMON_PARAMS = {\n isRoot: false,\n scope: import_createNonNativeContextMenu.CONTEXTMENU_CONTEXT\n};\nfunction createContextMenu(param) {\n var { Menu: NativeMenuRoot } = (0, import_create_menu.createNativeMenu)(\"ContextMenu\");\n var NonNativeContextMenu = (0, import_createNonNativeContextMenu.createNonNativeContextMenu)(param);\n var ContextMenuComp = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Root,\n NativeComponent: NativeMenuRoot,\n isRoot: true\n });\n var Trigger = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Trigger,\n NativeComponent: NativeMenuRoot.Trigger\n });\n var Portal = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Portal,\n NativeComponent: import_react.default.Fragment\n });\n var Content = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Content,\n NativeComponent: NativeMenuRoot.Content\n });\n var Preview = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Preview,\n NativeComponent: NativeMenuRoot.Preview\n });\n var Group = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Group,\n NativeComponent: NativeMenuRoot.Group\n });\n var Label = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Label,\n NativeComponent: NativeMenuRoot.Label\n });\n var Item = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Item,\n NativeComponent: NativeMenuRoot.Item\n });\n var ItemTitle = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemTitle,\n NativeComponent: NativeMenuRoot.ItemTitle\n });\n var ItemSubtitle = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemSubtitle,\n NativeComponent: NativeMenuRoot.ItemSubtitle\n });\n var ItemIcon = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemIcon,\n NativeComponent: NativeMenuRoot.ItemIcon\n });\n var ItemImage = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemImage,\n NativeComponent: NativeMenuRoot.ItemImage\n });\n var CheckboxItem = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.CheckboxItem,\n NativeComponent: NativeMenuRoot.CheckboxItem\n });\n var RadioGroup = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.RadioGroup,\n NativeComponent: function() {\n return null;\n }\n });\n var RadioItem = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.RadioItem,\n NativeComponent: function(param2) {\n var { children } = param2;\n return children;\n }\n });\n var ItemIndicator = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.ItemIndicator,\n NativeComponent: NativeMenuRoot.ItemIndicator\n });\n var Separator = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Separator,\n NativeComponent: NativeMenuRoot.Separator\n });\n var Arrow = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Arrow,\n NativeComponent: NativeMenuRoot.Arrow\n });\n var Sub = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.Sub,\n NativeComponent: NativeMenuRoot.Sub\n });\n var SubTrigger = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.SubTrigger,\n NativeComponent: NativeMenuRoot.SubTrigger\n });\n var SubContent = (0, import_create_menu.withNativeMenu)({\n ...COMMON_PARAMS,\n Component: NonNativeContextMenu.SubContent,\n NativeComponent: NativeMenuRoot.SubContent\n });\n var ContextMenu = (0, import_web.withStaticProperties)(ContextMenuComp, {\n Trigger,\n Portal,\n Content,\n Group,\n Label,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n ItemIndicator,\n Separator,\n Arrow,\n Sub,\n // cast to React.FC to avoid TS error\n SubTrigger,\n SubContent,\n ItemTitle,\n ItemSubtitle,\n // cast to React.FC to avoid TS error\n ItemIcon,\n ItemImage,\n Preview\n });\n return ContextMenu;\n}\n//# sourceMappingURL=ContextMenu.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,QAAQ,GAAGC,MAAM,CAACC,MAAM;AAC5B,IAAIC,SAAS,GAAGF,MAAM,CAACG,cAAc;AACrC,IAAIC,gBAAgB,GAAGJ,MAAM,CAACK,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGN,MAAM,CAACO,mBAAmB;AAClD,IAAIC,YAAY,GAAGR,MAAM,CAACS,cAAc;AACxC,IAAIC,YAAY,GAAGV,MAAM,CAACW,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBb,SAAS,CAACY,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIlB,iBAAiB,CAACe,IAAI,CAAC,EACrC,IAAI,CAACX,YAAY,CAACe,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/CpB,SAAS,CAACkB,EAAE,EAAEI,GAAG,EAAE;MAAEP,GAAG,EAAEA,CAAA,KAAMI,IAAI,CAACG,GAAG,CAAC;MAAEN,UAAU,EAAE,EAAEK,IAAI,GAAGnB,gBAAg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