{"_id":"@campino/rule-editor-ui","name":"@campino/rule-editor-ui","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@campino/rule-editor-ui","version":"1.0.0","description":"Graphical user interface for rule editor.","keywords":["campino","editor","hynek","hynek shop","rule","rule builder","rule editor"],"homepage":"https://github.com/hynek-systems/hynek-shop-ruled-editor-ui#readme","bugs":{"url":"https://github.com/hynek-systems/hynek-shop-ruled-editor-ui/issues"},"license":"MIT","author":{"name":"Henric Söderlind","email":"henric.soderlind@outlook.com"},"repository":{"type":"git","url":"git+https://github.com/hynek-systems/hynek-shop-ruled-editor-ui.git"},"type":"module","exports":{".":"./dist/index.mjs","./package.json":"./package.json","./style.css":"./dist/style.css"},"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","dev":"vp pack --watch","playground":"vp dev playground","test":"vp test","test:browser":"vp test --config vite.browser.config.ts","check":"vp check","prepublishOnly":"vp run build","prepare":"vp config"},"dependencies":{"@campino/frontend-interactions":"^1.0.1","@campino/rule":"^1.0.0","@campino/rule-editor":"^0.1.0"},"devDependencies":{"@types/node":"^26.1.1","@typescript/native-preview":"^7.0.0-dev.20260707.2","@vitest/browser-playwright":"^4.1.10","bumpp":"^11.1.0","jsdom":"^29.1.1","lucide":"^1.24.0","playwright":"^1.55.0","typescript":"^6.0.3","vite":"npm:@voidzero-dev/vite-plus-core@0.2.4","vite-plus":"^0.2.4"},"peerDependencies":{"lucide":"^1.24.0"},"overrides":{"vite":"npm:@voidzero-dev/vite-plus-core@0.2.4"},"devEngines":{"packageManager":{"name":"npm","version":"12.0.1","onFail":"download"}},"gitHead":"a7e3bfa8a2056f6d71df4cb38f5889c8bbc7e5c8","_id":"@campino/rule-editor-ui@1.0.0","_nodeVersion":"24.18.1","_npmVersion":"12.0.1","dist":{"integrity":"sha512-MJSHlWR0uMf0WD4D2u9LUKa8RXEF1EOK6JHDNnrixfMxM3AU0oAagG8A3RrxDcFMVxDB8Hei+1vOeQYUQtr95g==","shasum":"75ab2d3fefe1576ff9a26f238fc778091b735b87","tarball":"https://registry.npmjs.org/@campino/rule-editor-ui/-/rule-editor-ui-1.0.0.tgz","fileCount":6,"unpackedSize":46336,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD6xutGmZZU6hdttTP1Stf4DJiyABsN7N6qCTHMDV3rgAIgJpSfd0yb2FEYxGBEyF54vBb9lcTVIOqUQ1B4Ibgr2vY="}]},"_npmUser":{"name":"campino","email":"henric.soderlind@outlook.com"},"directories":{},"maintainers":[{"name":"campino","email":"henric.soderlind@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rule-editor-ui_1.0.0_1785596690799_0.22673723347823826"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-01T15:04:50.659Z","1.0.0":"2026-08-01T15:04:50.928Z","modified":"2026-08-01T15:04:51.136Z"},"maintainers":[{"name":"campino","email":"henric.soderlind@outlook.com"}],"description":"Graphical user interface for rule editor.","homepage":"https://github.com/hynek-systems/hynek-shop-ruled-editor-ui#readme","keywords":["campino","editor","hynek","hynek shop","rule","rule builder","rule editor"],"repository":{"type":"git","url":"git+https://github.com/hynek-systems/hynek-shop-ruled-editor-ui.git"},"author":{"name":"Henric Söderlind","email":"henric.soderlind@outlook.com"},"bugs":{"url":"https://github.com/hynek-systems/hynek-shop-ruled-editor-ui/issues"},"license":"MIT","readme":"# @campino/rule-editor-ui\n\nBrowser UI for creating and editing rule trees from `@campino/rule`.\n\n## Installation\n\n```bash\nnpm install @campino/rule-editor-ui @campino/rule lucide\n```\n\nImport the editor and its stylesheet:\n\n```ts\nimport { RuleEditorElement } from \"@campino/rule-editor-ui\";\nimport \"@campino/rule-editor-ui/style.css\";\n```\n\n## Usage\n\n```ts\nimport { Field, RuleContext, StringFieldType } from \"@campino/rule\";\nimport { RuleEditorElement } from \"@campino/rule-editor-ui\";\nimport \"@campino/rule-editor-ui/style.css\";\n\nconst context = new RuleContext();\n\ncontext.fields.register(new Field(\"country\", \"Country\", StringFieldType));\n\nconst editor = new RuleEditorElement({\n  name: \"rules\",\n  context,\n});\n\nconst container = document.querySelector<HTMLElement>(\"#rule-editor\");\n\nif (container) {\n  editor.mount(container);\n}\n```\n\nThe editor adds a hidden input named by the `name` option. Its value is synchronized with the\nserialized rule tree, so it can be submitted with a regular HTML form.\n\nCall `editor.destroy()` before removing a mounted editor. This removes rendered controls, global\nkeyboard listeners, menus, and sortable interactions.\n\n## Options\n\n- `context`: A configured `RuleContext` containing the fields available to the editor.\n- `name`: The name of the synchronized hidden form input.\n- `value`: An optional serialized rule tree or `RuleTree` instance.\n\n## Keyboard Controls\n\n- `Tab`: Move through editor controls.\n- `ArrowUp` / `ArrowDown`: Open and navigate field pickers.\n- `Home` / `End`: Move to the first or last field-picker option.\n- `Enter` / `Space`: Select a field-picker option.\n- `Escape`: Close an open picker or clear the current node selection.\n- `Delete` / `Backspace`: Delete the selected node when focus is inside the editor.\n- `Ctrl+Z` / `Cmd+Z`: Undo.\n- `Ctrl+Shift+Z` / `Cmd+Shift+Z`: Redo.\n\nDrag handles can also be focused and operated with the keyboard.\nField selection uses an ARIA listbox; the shorter operator lists intentionally use native selects.\n\n## Development\n\n```bash\nvp install\nvp run playground\nvp test\nvp run test:browser\nvp check\nvp pack\n```\n\nThe playground runs with Vite+ and reloads source changes during development.\n","readmeFilename":"README.md","_rev":"1-467c6d52fb2fad7cc589919ec67d8c2a"}