@panorama/plugin-kit (0.0.1-6.8.3-pm-0.0.1)

Published 2026-09-01 10:55:33 +00:00 by kurilevev

Installation

@panorama:registry=
npm install @panorama/plugin-kit@0.0.1-6.8.3-pm-0.0.1
"@panorama/plugin-kit": "0.0.1-6.8.3-pm-0.0.1"

About this package

@panorama/plugin-kit

Mq + web components + конструктор форм для плагинов Панорамы.

Плагин может быть на чём угодно (HTML / Vue / React / …). Preact зашит в бандл дизайнера.

Host: src/core/pluginIframeBridge.js в front3.

Установка

npm run build:plugin-kit   # из корня front3
npm i file:../front3/packages/panorama-plugin-kit

IIFE: dist/panorama-plugin-kit.iife.js → PanoramaPluginKit.

Сценарий: HTML + RUN

  1. <pn-form-designer>
  2. register(...) — tag / класс HTMLElement / mount (Vue/React/…)
  3. Кнопка RUN → form.collectData() → fetch → host.send(...)

Полный контракт: CONTRACT.md
Демо: examples/run.html

import { register, connectToHostMq } from '@panorama/plugin-kit';

register(MyText, 'MyText', { name: 'query', title: 'Запрос' });

const host = connectToHostMq({ events: ['openForTree'] });
await host.ready;

const form = document.querySelector('pn-form-designer');
document.querySelector('#run').onclick = async () => {
  const data = form.collectData();
  const result = await fetch('/api/run', {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify(data),
  }).then((r) => r.json());
  host.send('openForTree', result.ref);
};

API

API Назначение
connectToHostMq mq / call к Панораме
register виджет в Toolbox
pn-form-designer collectData, setData, get, set, changed
pn-object-select выбор MaCard по типу
pn-tree-object-select выбор узла дерева (openForTree)

Структура

src/
  mq-client/
  components/pn-object-select/
  components/pn-form-designer/

Dependencies

Dependencies

ID Version
preact ^10.29.7

Development Dependencies

ID Version
vite ^6.1.0

Keywords

panorama plugin web-components iframe
Details
npm
2026-09-01 10:55:33 +00:00
4
UNLICENSED
143 KiB
Assets (1)
Versions (13) View all
0.0.22 2026-10-09
0.0.21 2026-10-09
0.0.20 2026-10-09
0.0.1-9.3 2026-10-09
0.0.1-9.2 2026-10-08