@ai-matrx/context-menu 0.1.9 → 0.1.11
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/CHANGELOG.md +12 -0
- package/dist/builder.cjs +17 -18
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.js +2 -3
- package/dist/builder.js.map +1 -1
- package/dist/{chunk-ECKA474B.js → chunk-2B37SXQW.js} +21 -12
- package/dist/chunk-2B37SXQW.js.map +1 -0
- package/dist/{chunk-TSOUI723.cjs → chunk-7TIZAANU.cjs} +26 -11
- package/dist/chunk-7TIZAANU.cjs.map +1 -0
- package/dist/{chunk-A24SBKSA.js → chunk-EG23Y2KW.js} +14 -13
- package/dist/{chunk-A24SBKSA.js.map → chunk-EG23Y2KW.js.map} +1 -1
- package/dist/{chunk-7VDSMZWI.cjs → chunk-ERFH2RZC.cjs} +18 -17
- package/dist/chunk-ERFH2RZC.cjs.map +1 -0
- package/dist/{chunk-EIP5YS4Y.js → chunk-HJU3RU2B.js} +27 -12
- package/dist/chunk-HJU3RU2B.js.map +1 -0
- package/dist/{chunk-SWEWOUHK.cjs → chunk-IH5WN5JP.cjs} +31 -26
- package/dist/chunk-IH5WN5JP.cjs.map +1 -0
- package/dist/{chunk-QXHLM7SS.cjs → chunk-LDMYNYFC.cjs} +42 -33
- package/dist/chunk-LDMYNYFC.cjs.map +1 -0
- package/dist/{chunk-ANJYKQAA.cjs → chunk-MBU4Y22O.cjs} +3 -3
- package/dist/{chunk-ANJYKQAA.cjs.map → chunk-MBU4Y22O.cjs.map} +1 -1
- package/dist/{chunk-L6DPISFT.js → chunk-NBEXJ25Z.js} +24 -19
- package/dist/{chunk-L6DPISFT.js.map → chunk-NBEXJ25Z.js.map} +1 -1
- package/dist/{chunk-LE6ZUVCO.js → chunk-PB3PMDKV.js} +2 -2
- package/dist/{chunk-NOYMFNSU.js → chunk-SJWKMZEJ.js} +33 -12
- package/dist/chunk-SJWKMZEJ.js.map +1 -0
- package/dist/{chunk-XERD2YCJ.cjs → chunk-WROBL3DR.cjs} +32 -11
- package/dist/chunk-WROBL3DR.cjs.map +1 -0
- package/dist/design-store.cjs +0 -1
- package/dist/design-store.cjs.map +1 -1
- package/dist/design-store.js +0 -1
- package/dist/design-store.js.map +1 -1
- package/dist/engine.cjs +64 -96
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.d.cts +7 -7
- package/dist/engine.d.ts +7 -7
- package/dist/engine.js +72 -104
- package/dist/engine.js.map +1 -1
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/menu-content.cjs +18 -19
- package/dist/menu-content.cjs.map +1 -1
- package/dist/menu-content.js +4 -5
- package/dist/menu-content.js.map +1 -1
- package/dist/menu-inspect.cjs +0 -1
- package/dist/menu-inspect.cjs.map +1 -1
- package/dist/menu-inspect.js +0 -1
- package/dist/menu-inspect.js.map +1 -1
- package/dist/model.cjs +4 -5
- package/dist/model.cjs.map +1 -1
- package/dist/model.js +3 -4
- package/dist/react.cjs +52 -44
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +30 -22
- package/dist/react.js.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-7VDSMZWI.cjs.map +0 -1
- package/dist/chunk-CUODNUAD.cjs +0 -24
- package/dist/chunk-CUODNUAD.cjs.map +0 -1
- package/dist/chunk-ECKA474B.js.map +0 -1
- package/dist/chunk-EIP5YS4Y.js.map +0 -1
- package/dist/chunk-NOYMFNSU.js.map +0 -1
- package/dist/chunk-PE3ZHHM5.js +0 -24
- package/dist/chunk-PE3ZHHM5.js.map +0 -1
- package/dist/chunk-QXHLM7SS.cjs.map +0 -1
- package/dist/chunk-SWEWOUHK.cjs.map +0 -1
- package/dist/chunk-TSOUI723.cjs.map +0 -1
- package/dist/chunk-XERD2YCJ.cjs.map +0 -1
- /package/dist/{chunk-LE6ZUVCO.js.map → chunk-PB3PMDKV.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.11
|
|
4
|
+
|
|
5
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
6
|
+
`git diff npm/context-menu/v0.1.10..npm/context-menu/v0.1.11 -- apps/shared/context-menu`).
|
|
7
|
+
No source changes intended and no consumer action required.
|
|
8
|
+
|
|
9
|
+
## 0.1.10
|
|
10
|
+
|
|
11
|
+
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
|
12
|
+
`git diff npm/context-menu/v0.1.9..npm/context-menu/v0.1.10 -- apps/shared/context-menu`).
|
|
13
|
+
No source changes intended and no consumer action required.
|
|
14
|
+
|
|
3
15
|
## 0.1.9
|
|
4
16
|
|
|
5
17
|
Automatic changed-only republish (docs/metadata drift since the last tag — see
|
package/dist/builder.cjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkMBU4Y22Ocjs = require('./chunk-MBU4Y22O.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -31,8 +31,7 @@ var _chunkANJYKQAAcjs = require('./chunk-ANJYKQAA.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkPDHJTEZKcjs = require('./chunk-PDHJTEZK.cjs');
|
|
34
|
-
require('./chunk-
|
|
35
|
-
require('./chunk-CUODNUAD.cjs');
|
|
34
|
+
require('./chunk-LDMYNYFC.cjs');
|
|
36
35
|
|
|
37
36
|
// src/builder/MenuBuilder.tsx
|
|
38
37
|
var _react = require('react');
|
|
@@ -43,7 +42,7 @@ function maker(slug) {
|
|
|
43
42
|
const nid = () => `${slug}-${++n}`;
|
|
44
43
|
const clean = (o) => JSON.parse(JSON.stringify(o));
|
|
45
44
|
const item = (catalogId, extra = {}) => {
|
|
46
|
-
const c =
|
|
45
|
+
const c = _chunkMBU4Y22Ocjs.catalogOption.call(void 0, catalogId);
|
|
47
46
|
if (!c) throw new Error(`starters: no catalog row ${catalogId}`);
|
|
48
47
|
return clean({
|
|
49
48
|
id: nid(),
|
|
@@ -4403,7 +4402,7 @@ function usePointerDrag(onDrop) {
|
|
|
4403
4402
|
}
|
|
4404
4403
|
function nodeFromPayload(p) {
|
|
4405
4404
|
if (p.type === "catalog") {
|
|
4406
|
-
const c =
|
|
4405
|
+
const c = _chunkMBU4Y22Ocjs.catalogOption.call(void 0, p.id);
|
|
4407
4406
|
if (!c) return null;
|
|
4408
4407
|
return {
|
|
4409
4408
|
id: _chunkPDHJTEZKcjs.newId.call(void 0, "i"),
|
|
@@ -4428,7 +4427,7 @@ function nodeFromPayload(p) {
|
|
|
4428
4427
|
note: `From the audit (${f.importance}, ${f.coverage}): ${f.feature} \u2014 today: ${f.surface} (${f.source})`
|
|
4429
4428
|
};
|
|
4430
4429
|
}
|
|
4431
|
-
if (p.type === "template") return _nullishCoalesce(_optionalChain([
|
|
4430
|
+
if (p.type === "template") return _nullishCoalesce(_optionalChain([_chunkMBU4Y22Ocjs.TEMPLATES, 'access', _5 => _5.find, 'call', _6 => _6((t) => t.id === p.id), 'optionalAccess', _7 => _7.build, 'call', _8 => _8()]), () => ( null));
|
|
4432
4431
|
if (p.type === "new") {
|
|
4433
4432
|
if (p.kind === "section") return { id: _chunkPDHJTEZKcjs.newId.call(void 0, "s"), kind: "section", label: "New section", children: [] };
|
|
4434
4433
|
if (p.kind === "submenu") return { id: _chunkPDHJTEZKcjs.newId.call(void 0, "m"), kind: "submenu", label: "More", icon: "Ellipsis", children: [] };
|
|
@@ -4761,11 +4760,11 @@ function Palette({ onAdd, startDrag, click }) {
|
|
|
4761
4760
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Option, { p: { type: "new", kind: "slot-feature" }, icon: "PanelTop", label: "Feature section" }),
|
|
4762
4761
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Option, { p: { type: "new", kind: "search" }, icon: "Search", label: "Search box" })
|
|
4763
4762
|
] }),
|
|
4764
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _controls.RowGroup, { title: "Ready-made", children:
|
|
4763
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _controls.RowGroup, { title: "Ready-made", children: _chunkMBU4Y22Ocjs.TEMPLATES.map((t) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Option, { p: { type: "template", id: t.id }, icon: t.icon, label: t.label }, t.id)) })
|
|
4765
4764
|
] }),
|
|
4766
4765
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AuditPalette, { query, uses, Option }),
|
|
4767
|
-
|
|
4768
|
-
const matching =
|
|
4766
|
+
_chunkMBU4Y22Ocjs.CATALOG_GROUPS.map((g) => {
|
|
4767
|
+
const matching = _chunkMBU4Y22Ocjs.CATALOG.filter((c) => c.group === g && shown(c));
|
|
4769
4768
|
const items = [...matching.filter((c) => !uses.has(c.id)), ...matching.filter((c) => uses.has(c.id))];
|
|
4770
4769
|
if (items.length === 0) return null;
|
|
4771
4770
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _controls.RowGroup, { title: g, children: items.map((c) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4854,7 +4853,7 @@ function Rows(props) {
|
|
|
4854
4853
|
const container = _chunkPDHJTEZKcjs.isContainer.call(void 0, node);
|
|
4855
4854
|
const isOver = _optionalChain([over, 'optionalAccess', _22 => _22.id]) === node.id;
|
|
4856
4855
|
const label = node.kind === "divider" ? "\u2500\u2500\u2500\u2500 divider \u2500\u2500\u2500\u2500" : node.kind === "search" ? `Search box \u2014 \u201C${node.placeholder}\u201D` : node.label || (node.kind === "section" ? "(unlabelled section)" : "(no label)");
|
|
4857
|
-
const icon = node.kind === "item" || node.kind === "submenu" ? node.icon : node.kind === "search" ? "Search" : node.kind === "slot" ? _nullishCoalesce(_nullishCoalesce(node.icon, () => ( _optionalChain([
|
|
4856
|
+
const icon = node.kind === "item" || node.kind === "submenu" ? node.icon : node.kind === "search" ? "Search" : node.kind === "slot" ? _nullishCoalesce(_nullishCoalesce(node.icon, () => ( _optionalChain([_chunkMBU4Y22Ocjs.slotSource.call(void 0, node.fills), 'optionalAccess', _23 => _23.icon]))), () => ( "Ellipsis")) : node.kind === "section" ? "Rows3" : "Minus";
|
|
4858
4857
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
4859
4858
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4860
4859
|
"div",
|
|
@@ -4998,7 +4997,7 @@ function Stage({ design: design2, selected, onSelect }) {
|
|
|
4998
4997
|
className: "relative min-h-[300px] overflow-visible rounded-lg bg-muted/60 p-4",
|
|
4999
4998
|
children: [
|
|
5000
4999
|
at ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5001
|
-
|
|
5000
|
+
_chunkMBU4Y22Ocjs.MenuPreview,
|
|
5002
5001
|
{
|
|
5003
5002
|
design: design2,
|
|
5004
5003
|
renderIcon: renderLucide,
|
|
@@ -5008,7 +5007,7 @@ function Stage({ design: design2, selected, onSelect }) {
|
|
|
5008
5007
|
availability,
|
|
5009
5008
|
style: { position: "absolute", left: at.x, top: at.y, zIndex: 20 }
|
|
5010
5009
|
}
|
|
5011
|
-
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5010
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMBU4Y22Ocjs.MenuPreview, { design: design2, renderIcon: renderLucide, highlightId: selected, onSelectNode: onSelect, onPick: (i) => setPicked(i.label), availability }),
|
|
5012
5011
|
picked && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "type-meta absolute right-3 bottom-2", children: [
|
|
5013
5012
|
"Picked: ",
|
|
5014
5013
|
picked,
|
|
@@ -5087,7 +5086,7 @@ function keywordsFrom(text) {
|
|
|
5087
5086
|
return text.split(",").map((w) => w.trim()).filter(Boolean);
|
|
5088
5087
|
}
|
|
5089
5088
|
function Inspector({ node, onChange }) {
|
|
5090
|
-
const catalog = node.catalogId ?
|
|
5089
|
+
const catalog = node.catalogId ? _chunkMBU4Y22Ocjs.catalogOption.call(void 0, node.catalogId) : void 0;
|
|
5091
5090
|
const kindName = node.kind === "slot" ? node.shape === "feature" ? "feature section" : "placeholder" : node.kind === "search" ? "search box" : node.kind;
|
|
5092
5091
|
const [keywordDraft, setKeywordDraft] = _react.useState.call(void 0, keywordsText(node.keywords));
|
|
5093
5092
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Panel, { title: `Selected ${kindName}`, right: catalog ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _controls.Badge, { children: catalog.id }) : void 0, children: [
|
|
@@ -5151,9 +5150,9 @@ var SLOT_SHAPES = [
|
|
|
5151
5150
|
{ value: "submenu", label: "One submenu" },
|
|
5152
5151
|
{ value: "feature", label: "Feature section" }
|
|
5153
5152
|
];
|
|
5154
|
-
var SLOT_OPTIONS =
|
|
5153
|
+
var SLOT_OPTIONS = _chunkMBU4Y22Ocjs.SLOT_SOURCES.map((src) => ({ value: src.id, label: src.label }));
|
|
5155
5154
|
function SlotSettings({ node, onChange }) {
|
|
5156
|
-
const source =
|
|
5155
|
+
const source = _chunkMBU4Y22Ocjs.slotSource.call(void 0, node.fills);
|
|
5157
5156
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
5158
5157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Labelled, { label: "Holds", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5159
5158
|
_controls.Select,
|
|
@@ -5163,7 +5162,7 @@ function SlotSettings({ node, onChange }) {
|
|
|
5163
5162
|
options: SLOT_OPTIONS,
|
|
5164
5163
|
onValueChange: (fills) => {
|
|
5165
5164
|
const relabel = !node.label || node.label === _optionalChain([source, 'optionalAccess', _37 => _37.phrase]) || node.label === "Everything else" || node.label === "More";
|
|
5166
|
-
onChange({ fills, ...relabel ? { label: _nullishCoalesce(_optionalChain([
|
|
5165
|
+
onChange({ fills, ...relabel ? { label: _nullishCoalesce(_optionalChain([_chunkMBU4Y22Ocjs.slotSource.call(void 0, fills), 'optionalAccess', _38 => _38.phrase]), () => ( node.label)) } : {} });
|
|
5167
5166
|
}
|
|
5168
5167
|
}
|
|
5169
5168
|
) }),
|
|
@@ -5175,9 +5174,9 @@ function SlotSettings({ node, onChange }) {
|
|
|
5175
5174
|
] });
|
|
5176
5175
|
}
|
|
5177
5176
|
function SlotContents({ fills }) {
|
|
5178
|
-
const source =
|
|
5177
|
+
const source = _chunkMBU4Y22Ocjs.slotSource.call(void 0, fills);
|
|
5179
5178
|
const design2 = _react.useContext.call(void 0, DesignContext);
|
|
5180
|
-
const left = _react.useMemo.call(void 0, () => design2 ?
|
|
5179
|
+
const left = _react.useMemo.call(void 0, () => design2 ? _chunkMBU4Y22Ocjs.slotOptions.call(void 0, fills, _chunkPDHJTEZKcjs.placedCatalogIds.call(void 0, design2.nodes)) : [], [design2, fills]);
|
|
5181
5180
|
if (_optionalChain([source, 'optionalAccess', _39 => _39.runtime])) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "type-secondary mt-2", children: "Filled by the live menu at runtime." });
|
|
5182
5181
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "type-secondary mt-2", children: left.length === 0 ? "Nothing left \u2014 every option of this kind is already placed." : `Holds ${left.length}: ${left.slice(0, 6).map((o) => o.label).join(", ")}${left.length > 6 ? "\u2026" : ""}` });
|
|
5183
5182
|
}
|