@aparte/plugin-approval 0.19.3 → 0.20.0

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.
@@ -26,7 +26,7 @@ import { type ApprovalMode } from './policy.js';
26
26
  * </aparte-composer>
27
27
  * ```
28
28
  *
29
- * @fires aparte-approval-mode-change - After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.
29
+ * @fires {CustomEvent<AparteApprovalModeChangeEventDetail>} aparte-approval-mode-change - After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.
30
30
  */
31
31
  export declare class AparteApprovalMode extends HTMLElement implements AparteConfigAware {
32
32
  private _cfg;
@@ -1 +1 @@
1
- {"version":3,"file":"aparte-approval-mode.d.ts","sourceRoot":"","sources":["../src/aparte-approval-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEH,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAE5C,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAShE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,SAAQ,WAAY,YAAW,iBAAiB;IAC5E,OAAO,CAAC,IAAI,CAA6B;IACzC,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA6C;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAWxB;IAEF,8FAA8F;IAC9F,IAAI,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAyB;IAC5E,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,EAGrD;IAED,iDAAiD;IACjD,IAAI,IAAI,IAAI,YAAY,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AKrB"}
@@ -146,6 +146,9 @@
146
146
  ],
147
147
  "events": [
148
148
  {
149
+ "type": {
150
+ "text": "CustomEvent<AparteApprovalModeChangeEventDetail>"
151
+ },
149
152
  "description": "After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.",
150
153
  "name": "aparte-approval-mode-change"
151
154
  }
package/dist/index.js CHANGED
@@ -64,7 +64,10 @@ class AparteApprovalMode extends HTMLElement {
64
64
  this._unsubscribe?.();
65
65
  this._controller = next;
66
66
  if (!this._controller) {
67
- console.warn("[aparte] <aparte-approval-mode> found no approval setup on the config it resolves — call setupApproval() from @aparte/plugin-approval on that config (the scoped one if you passed a `config`, aparteGlobalConfig otherwise).");
67
+ queueMicrotask(() => {
68
+ if (this._controller || !this.isConnected) return;
69
+ console.warn("[aparte] <aparte-approval-mode> found no approval setup on the config it resolves — call setupApproval() from @aparte/plugin-approval on that config (the scoped one if you passed a `config`, aparteGlobalConfig otherwise).");
70
+ });
68
71
  }
69
72
  this._unsubscribe = this._controller?.subscribe(() => this._syncValue()) ?? null;
70
73
  this._render();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/aparte-approval-mode.ts"],"sourcesContent":["/**\n * `<aparte-approval-mode>` — the switch between the four modes, for the composer's toolbar.\n *\n * Mounted where the host wants it, like `<aparte-model-selector>`: the composer is light\n * DOM with no registry, so a control is placed by writing its tag inside\n * `<aparte-composer-toolbar>`. It resolves the config it sits in (`resolveConfig`) and the\n * controller `setupApproval` installed there — with none, it renders disabled and says\n * so once in the console, the way core does for a missing presenter: an affordance that\n * cannot act is not offered.\n */\nimport {\n resolveConfig, subscribeConfigChange, escapeHtml, escapeAttr,\n type AparteConfig, type AparteConfigAware, type AparteSelectChangeDetail,\n type AparteApprovalModeChangeEventDetail,\n} from '@aparte/core';\nimport { getApprovalController, type ApprovalController } from './approval.js';\nimport { APPROVAL_MODES, type ApprovalMode } from './policy.js';\n\nconst DEFAULT_LABELS: Record<ApprovalMode, string> = {\n plan: 'Plan',\n ask: 'Ask',\n 'auto-edit': 'Auto-edit',\n auto: 'Auto',\n};\n\n/**\n * A select over the four approval modes — plan, ask, auto-edit, auto — bound to the\n * `setupApproval()` of the config this element resolves.\n *\n * @element aparte-approval-mode\n *\n * @example Beside the model selector, in the composer's toolbar\n * ```html\n * <aparte-composer>\n * <aparte-composer-input></aparte-composer-input>\n * <aparte-composer-toolbar>\n * <aparte-approval-mode></aparte-approval-mode>\n * </aparte-composer-toolbar>\n * </aparte-composer>\n * ```\n *\n * @fires aparte-approval-mode-change - After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.\n */\nexport class AparteApprovalMode extends HTMLElement implements AparteConfigAware {\n private _cfg: AparteConfig | null = null;\n private _controller: ApprovalController | undefined;\n private _unsubscribe: (() => void) | null = null;\n private _configUnsubscribe: (() => void) | null = null;\n private _bound = false;\n private _labels: Partial<Record<ApprovalMode, string>> = {};\n private readonly _onChange = (e: Event): void => {\n const detail = (e as CustomEvent<AparteSelectChangeDetail>).detail;\n const next = detail?.value as ApprovalMode;\n if (!this._controller || !APPROVAL_MODES.includes(next)) return;\n const previous = this._controller.getMode();\n this._controller.setMode(next);\n if (this._controller.getMode() !== previous) {\n this.dispatchEvent(new CustomEvent<AparteApprovalModeChangeEventDetail>('aparte-approval-mode-change', {\n bubbles: true, composed: true, detail: { mode: next, previousMode: previous },\n }));\n }\n };\n\n /** The label of each mode, for a localised host. Missing entries keep the English default. */\n get labels(): Partial<Record<ApprovalMode, string>> { return this._labels; }\n set labels(next: Partial<Record<ApprovalMode, string>>) {\n this._labels = next ?? {};\n if (this.isConnected) this._render();\n }\n\n /** The current mode, or `null` with no setup. */\n get mode(): ApprovalMode | null { return this._controller?.getMode() ?? null; }\n\n connectedCallback(): void {\n this._bind(resolveConfig(this));\n // A setup that arrives AFTER this element mounted (a later script, a dynamic\n // import), or one that goes away (`dispose()`, `config.reset()`): the config\n // notifies on `setApprovalPolicy`, and the switch re-resolves its controller\n // rather than staying disabled — or wired to nothing — for the life of the page.\n this._configUnsubscribe = subscribeConfigChange(this, () => this._bind(resolveConfig(this)));\n }\n\n disconnectedCallback(): void {\n this._unsubscribe?.();\n this._unsubscribe = null;\n this._configUnsubscribe?.();\n this._configUnsubscribe = null;\n this._bound = false;\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n }\n\n /** See `AparteConfigAware`: a boundary moved, so the controller may be another one. */\n aparteConfigChanged(next: AparteConfig): void {\n this._bind(next);\n }\n\n private _bind(cfg: AparteConfig): void {\n const next = getApprovalController(cfg);\n // An unrelated notify (a locale, a provider) must not rebuild the select under an\n // open dropdown: same config, same controller, nothing to rebind.\n if (this._bound && cfg === this._cfg && next === this._controller) return;\n this._bound = true;\n this._cfg = cfg;\n this._unsubscribe?.();\n this._controller = next;\n if (!this._controller) {\n console.warn('[aparte] <aparte-approval-mode> found no approval setup on the config it resolves — call setupApproval() from @aparte/plugin-approval on that config (the scoped one if you passed a `config`, aparteGlobalConfig otherwise).');\n }\n this._unsubscribe = this._controller?.subscribe(() => this._syncValue()) ?? null;\n this._render();\n }\n\n private _render(): void {\n const controller = this._controller;\n const current = controller?.getMode();\n const options = APPROVAL_MODES.map((m) =>\n `<aparte-option value=\"${escapeAttr(m)}\">${escapeHtml(this._labels[m] ?? DEFAULT_LABELS[m])}</aparte-option>`).join('');\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n // The select carries no class of ours: `aparte-approval-mode aparte-select` is\n // already the address a consumer restyling it writes.\n // The accessible name follows the locale like the option labels do — a\n // literal here was the one string a localised host could not translate.\n const aria = String(this._cfg?.getLocale()['approvalModeLabel'] || 'Approval mode');\n this.innerHTML = `<aparte-select${current ? ` value=\"${escapeAttr(current)}\"` : ''}${controller ? '' : ' disabled'} aria-label=\"${escapeAttr(aria)}\">${options}</aparte-select>`;\n this.querySelector('aparte-select')?.addEventListener('aparte-select-change', this._onChange);\n }\n\n private _syncValue(): void {\n const select = this.querySelector('aparte-select') as (HTMLElement & { value: string }) | null;\n const mode = this._controller?.getMode();\n if (select && mode && select.value !== mode) select.value = mode;\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('aparte-approval-mode')) {\n customElements.define('aparte-approval-mode', AparteApprovalMode);\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,iBAA+C;AAAA,EACjD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,aAAa;AAAA,EACb,MAAM;AACV;AAoBO,MAAM,2BAA2B,YAAyC;AAAA,EACrE,OAA4B;AAAA,EAC5B;AAAA,EACA,eAAoC;AAAA,EACpC,qBAA0C;AAAA,EAC1C,SAAS;AAAA,EACT,UAAiD,CAAA;AAAA,EACxC,YAAY,CAAC,MAAmB;AAC7C,UAAM,SAAU,EAA4C;AAC5D,UAAM,OAAO,QAAQ;AACrB,QAAI,CAAC,KAAK,eAAe,CAAC,eAAe,SAAS,IAAI,EAAG;AACzD,UAAM,WAAW,KAAK,YAAY,QAAA;AAClC,SAAK,YAAY,QAAQ,IAAI;AAC7B,QAAI,KAAK,YAAY,QAAA,MAAc,UAAU;AACzC,WAAK,cAAc,IAAI,YAAiD,+BAA+B;AAAA,QACnG,SAAS;AAAA,QAAM,UAAU;AAAA,QAAM,QAAQ,EAAE,MAAM,MAAM,cAAc,SAAA;AAAA,MAAS,CAC/E,CAAC;AAAA,IACN;AAAA,EACJ;AAAA;AAAA,EAGA,IAAI,SAAgD;AAAE,WAAO,KAAK;AAAA,EAAS;AAAA,EAC3E,IAAI,OAAO,MAA6C;AACpD,SAAK,UAAU,QAAQ,CAAA;AACvB,QAAI,KAAK,YAAa,MAAK,QAAA;AAAA,EAC/B;AAAA;AAAA,EAGA,IAAI,OAA4B;AAAE,WAAO,KAAK,aAAa,QAAA,KAAa;AAAA,EAAM;AAAA,EAE9E,oBAA0B;AACtB,SAAK,MAAM,cAAc,IAAI,CAAC;AAK9B,SAAK,qBAAqB,sBAAsB,MAAM,MAAM,KAAK,MAAM,cAAc,I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,SAAS,KAAK,cAAc,eAAe;AACjD,UAAM,OAAO,KAAK,aAAa,QAAA;AAC/B,QAAI,UAAU,QAAQ,OAAO,UAAU,aAAa,QAAQ;AAAA,EAChE;AACJ;AAEA,IAAI,OAAO,mBAAmB,eAAe,CAAC,eAAe,IAAI,sBAAsB,GAAG;AACtF,iBAAe,OAAO,wBAAwB,kBAAkB;AACpE;"}
1
+ {"version":3,"file":"index.js","sources":["../src/aparte-approval-mode.ts"],"sourcesContent":["/**\n * `<aparte-approval-mode>` — the switch between the four modes, for the composer's toolbar.\n *\n * Mounted where the host wants it, like `<aparte-model-selector>`: the composer is light\n * DOM with no registry, so a control is placed by writing its tag inside\n * `<aparte-composer-toolbar>`. It resolves the config it sits in (`resolveConfig`) and the\n * controller `setupApproval` installed there — with none, it renders disabled and says\n * so once in the console, the way core does for a missing presenter: an affordance that\n * cannot act is not offered.\n */\nimport {\n resolveConfig, subscribeConfigChange, escapeHtml, escapeAttr,\n type AparteConfig, type AparteConfigAware, type AparteSelectChangeDetail,\n type AparteApprovalModeChangeEventDetail,\n} from '@aparte/core';\nimport { getApprovalController, type ApprovalController } from './approval.js';\nimport { APPROVAL_MODES, type ApprovalMode } from './policy.js';\n\nconst DEFAULT_LABELS: Record<ApprovalMode, string> = {\n plan: 'Plan',\n ask: 'Ask',\n 'auto-edit': 'Auto-edit',\n auto: 'Auto',\n};\n\n/**\n * A select over the four approval modes — plan, ask, auto-edit, auto — bound to the\n * `setupApproval()` of the config this element resolves.\n *\n * @element aparte-approval-mode\n *\n * @example Beside the model selector, in the composer's toolbar\n * ```html\n * <aparte-composer>\n * <aparte-composer-input></aparte-composer-input>\n * <aparte-composer-toolbar>\n * <aparte-approval-mode></aparte-approval-mode>\n * </aparte-composer-toolbar>\n * </aparte-composer>\n * ```\n *\n * @fires {CustomEvent<AparteApprovalModeChangeEventDetail>} aparte-approval-mode-change - After a switch: `{ mode, previousMode }`. Bubbles and crosses shadow roots.\n */\nexport class AparteApprovalMode extends HTMLElement implements AparteConfigAware {\n private _cfg: AparteConfig | null = null;\n private _controller: ApprovalController | undefined;\n private _unsubscribe: (() => void) | null = null;\n private _configUnsubscribe: (() => void) | null = null;\n private _bound = false;\n private _labels: Partial<Record<ApprovalMode, string>> = {};\n private readonly _onChange = (e: Event): void => {\n const detail = (e as CustomEvent<AparteSelectChangeDetail>).detail;\n const next = detail?.value as ApprovalMode;\n if (!this._controller || !APPROVAL_MODES.includes(next)) return;\n const previous = this._controller.getMode();\n this._controller.setMode(next);\n if (this._controller.getMode() !== previous) {\n this.dispatchEvent(new CustomEvent<AparteApprovalModeChangeEventDetail>('aparte-approval-mode-change', {\n bubbles: true, composed: true, detail: { mode: next, previousMode: previous },\n }));\n }\n };\n\n /** The label of each mode, for a localised host. Missing entries keep the English default. */\n get labels(): Partial<Record<ApprovalMode, string>> { return this._labels; }\n set labels(next: Partial<Record<ApprovalMode, string>>) {\n this._labels = next ?? {};\n if (this.isConnected) this._render();\n }\n\n /** The current mode, or `null` with no setup. */\n get mode(): ApprovalMode | null { return this._controller?.getMode() ?? null; }\n\n connectedCallback(): void {\n this._bind(resolveConfig(this));\n // A setup that arrives AFTER this element mounted (a later script, a dynamic\n // import), or one that goes away (`dispose()`, `config.reset()`): the config\n // notifies on `setApprovalPolicy`, and the switch re-resolves its controller\n // rather than staying disabled — or wired to nothing — for the life of the page.\n this._configUnsubscribe = subscribeConfigChange(this, () => this._bind(resolveConfig(this)));\n }\n\n disconnectedCallback(): void {\n this._unsubscribe?.();\n this._unsubscribe = null;\n this._configUnsubscribe?.();\n this._configUnsubscribe = null;\n this._bound = false;\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n }\n\n /** See `AparteConfigAware`: a boundary moved, so the controller may be another one. */\n aparteConfigChanged(next: AparteConfig): void {\n this._bind(next);\n }\n\n private _bind(cfg: AparteConfig): void {\n const next = getApprovalController(cfg);\n // An unrelated notify (a locale, a provider) must not rebuild the select under an\n // open dropdown: same config, same controller, nothing to rebind.\n if (this._bound && cfg === this._cfg && next === this._controller) return;\n this._bound = true;\n this._cfg = cfg;\n this._unsubscribe?.();\n this._controller = next;\n if (!this._controller) {\n // Asked once the module that imported the plugin has run its body. Importing the\n // plugin defines this element, so a tag already in the page binds BEFORE the\n // `setupApproval()` that comes next in the documented order — and the warning\n // fired for a setup that was a line away.\n queueMicrotask(() => {\n if (this._controller || !this.isConnected) return;\n console.warn('[aparte] <aparte-approval-mode> found no approval setup on the config it resolves — call setupApproval() from @aparte/plugin-approval on that config (the scoped one if you passed a `config`, aparteGlobalConfig otherwise).');\n });\n }\n this._unsubscribe = this._controller?.subscribe(() => this._syncValue()) ?? null;\n this._render();\n }\n\n private _render(): void {\n const controller = this._controller;\n const current = controller?.getMode();\n const options = APPROVAL_MODES.map((m) =>\n `<aparte-option value=\"${escapeAttr(m)}\">${escapeHtml(this._labels[m] ?? DEFAULT_LABELS[m])}</aparte-option>`).join('');\n this.querySelector('aparte-select')?.removeEventListener('aparte-select-change', this._onChange);\n // The select carries no class of ours: `aparte-approval-mode aparte-select` is\n // already the address a consumer restyling it writes.\n // The accessible name follows the locale like the option labels do — a\n // literal here was the one string a localised host could not translate.\n const aria = String(this._cfg?.getLocale()['approvalModeLabel'] || 'Approval mode');\n this.innerHTML = `<aparte-select${current ? ` value=\"${escapeAttr(current)}\"` : ''}${controller ? '' : ' disabled'} aria-label=\"${escapeAttr(aria)}\">${options}</aparte-select>`;\n this.querySelector('aparte-select')?.addEventListener('aparte-select-change', this._onChange);\n }\n\n private _syncValue(): void {\n const select = this.querySelector('aparte-select') as (HTMLElement & { value: string }) | null;\n const mode = this._controller?.getMode();\n if (select && mode && select.value !== mode) select.value = mode;\n }\n}\n\nif (typeof customElements !== 'undefined' && !customElements.get('aparte-approval-mode')) {\n customElements.define('aparte-approval-mode', AparteApprovalMode);\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,iBAA+C;AAAA,EACjD,MAAM;AAAA,EACN,KAAK;AAAA,EACL,aAAa;AAAA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,GAAG;AACtF,iBAAe,OAAO,wBAAwB,kBAAkB;AACpE;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aparte/plugin-approval",
3
- "version": "0.19.3",
3
+ "version": "0.20.0",
4
4
  "homepage": "https://apartejs.dev/plugins/approval/",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,6 +19,26 @@
19
19
  "types": "./dist/index.node.d.ts",
20
20
  "default": "./dist/index.node.js"
21
21
  },
22
+ "worker": {
23
+ "types": "./dist/index.node.d.ts",
24
+ "default": "./dist/index.node.js"
25
+ },
26
+ "workerd": {
27
+ "types": "./dist/index.node.d.ts",
28
+ "default": "./dist/index.node.js"
29
+ },
30
+ "edge-light": {
31
+ "types": "./dist/index.node.d.ts",
32
+ "default": "./dist/index.node.js"
33
+ },
34
+ "deno": {
35
+ "types": "./dist/index.node.d.ts",
36
+ "default": "./dist/index.node.js"
37
+ },
38
+ "bun": {
39
+ "types": "./dist/index.node.d.ts",
40
+ "default": "./dist/index.node.js"
41
+ },
22
42
  "types": "./dist/index.d.ts",
23
43
  "import": "./dist/index.js",
24
44
  "default": "./dist/index.js"
@@ -33,13 +53,13 @@
33
53
  "node": ">=18"
34
54
  },
35
55
  "peerDependencies": {
36
- "@aparte/core": ">=0.19.3 <1.0.0"
56
+ "@aparte/core": ">=0.20.0 <1.0.0"
37
57
  },
38
58
  "devDependencies": {
39
59
  "@custom-elements-manifest/analyzer": "^0.11.0",
40
60
  "typescript": "^5.4.0",
41
61
  "vite": "^6.0.0",
42
- "@aparte/core": "0.19.3"
62
+ "@aparte/core": "0.20.0"
43
63
  },
44
64
  "keywords": [
45
65
  "aparte",
@@ -61,7 +81,7 @@
61
81
  },
62
82
  "scripts": {
63
83
  "dev": "vite",
64
- "build": "vite build && tsc -b --emitDeclarationOnly --force && pnpm run analyze",
84
+ "build": "vite build && tsc -b --emitDeclarationOnly --force && pnpm run analyze && node ../../../scripts/stamp-dist.mjs",
65
85
  "analyze": "cem analyze",
66
86
  "preview": "vite preview",
67
87
  "test": "vitest",