@wcstack/idle 1.30.0 → 1.31.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.
- package/dist/auto.min.js +1 -1
- package/dist/auto.min.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +10 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/auto.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={tagNames:{idle:"wcs-idle"}},t="capability-missing",r="not-allowed",s="idle-error";class n extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"userState",event:"wcs-idle:change",semantics:"state",getter:e=>e.detail.userState},{name:"screenState",event:"wcs-idle:change",semantics:"state",getter:e=>e.detail.screenState},{name:"active",event:"wcs-idle:change",semantics:"state",getter:e=>"active"===e.detail.userState},{name:"error",event:"wcs-idle:error",semantics:"state"},{name:"errorInfo",event:"wcs-idle:error-info-changed",semantics:"state"}],commands:[{name:"requestPermission",async:!0},{name:"start",async:!0},{name:"stop"}]};_target;_userState=null;_screenState=null;_error=null;_errorInfo=null;_detector=null;_abortController=null;_gen=0;_ready=Promise.resolve();constructor(e){super(),this._target=e??this}get ready(){return this._ready}get userState(){return this._userState}get screenState(){return this._screenState}get active(){return"active"===this._userState}get error(){return this._error}get errorInfo(){return this._errorInfo}observe(){return this._ready}dispose(){this.stop()}_api(){const e=globalThis;return"function"==typeof e.IdleDetector?e.IdleDetector:void 0}_setState(e,t){this._userState===e&&this._screenState===t||(this._userState=e,this._screenState=t,this._target.dispatchEvent(new CustomEvent("wcs-idle:change",{detail:{userState:e,screenState:t},bubbles:!0})))}_setError(e,n){this._error!==e&&(this._error=e,this._commitErrorInfo(null===e?null:function(e,n){return"unsupported"===e?{code:t,phase:"probe",recoverable:!1,message:n}:"NotAllowedError"===e?{code:r,phase:"start",recoverable:!1,message:n}:{code:s,phase:"execute",recoverable:!1,message:n}}(n,this._errorInfoMessage(e))),this._target.dispatchEvent(new CustomEvent("wcs-idle:error",{detail:e,bubbles:!0})))}_errorInfoMessage(e){const t=null!=e&&"object"==typeof e&&"error"in e?e.error:e;return"string"==typeof t?.message?t.message:String(t)}_commitErrorInfo(e){this._errorInfo=e,this._target.dispatchEvent(new CustomEvent("wcs-idle:error-info-changed",{detail:e,bubbles:!0}))}async requestPermission(){const e=this._api();if(!e)return this._setError({message:"IdleDetector is not supported in this browser"},"unsupported"),"denied";try{const t=await e.requestPermission();return this._setError(null),"granted"===t?"granted":"denied"}catch(e){return this._setError({error:e},e?.name),"denied"}}async start(e=6e4){this.stop();const t=this._api();if(!t)return void this._setError({message:"IdleDetector is not supported in this browser"},"unsupported");const r=new AbortController;this._abortController=r;const s=++this._gen;try{const n=new t;if(n.addEventListener("change",this._onChange),this._detector=n,await n.start({threshold:e,signal:r.signal}),s!==this._gen)return;this._setError(null),this._setState(n.userState,n.screenState)}catch(e){if(s!==this._gen)return;this._detector?.removeEventListener("change",this._onChange),this._detector=null,this._abortController=null,this._setError({error:e},e?.name)}}stop(){this._gen++,this._abortController?.abort(),this._abortController=null,this._detector&&(this._detector.removeEventListener("change",this._onChange),this._detector=null)}_onChange=e=>{const t=e.target;this._setState(t.userState,t.screenState)}}function o(e,t){let r=Object.getPrototypeOf(e);for(;null!==r;){const e=Object.getOwnPropertyDescriptor(r,t);if(void 0!==e)return"function"==typeof e.get||"function"==typeof e.set;r=Object.getPrototypeOf(r)}return!1}class i extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...n.wcBindable,inputs:[{name:"threshold",attribute:"threshold"}],commands:n.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new n(this),this._internals=this._initInternals(),this._wireStates({"wcs-idle:change":e=>({active:"active"===e.userState}),"wcs-idle:error":e=>({error:null!=e})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const e=this.attachInternals();return e.states.add("wcs-probe"),e.states.delete("wcs-probe"),e}catch{return null}}_wireStates(e){if(null===this._internals)return;const t=this._internals.states;for(const[r,s]of Object.entries(e))this.addEventListener(r,e=>{const r=this.hasAttribute("debug-states");for(const[n,o]of Object.entries(s(e.detail))){try{o?t.add(n):t.delete(n)}catch{}r&&this.toggleAttribute(`data-wcs-state-${n}`,o)}})}get threshold(){const e=this.getAttribute("threshold");if(null===e||""===e.trim())return 6e4;const t=Number(e);return Number.isFinite(t)?t:6e4}set threshold(e){this.setAttribute("threshold",String(e))}get userState(){return this._core.userState}get screenState(){return this._core.screenState}get active(){return this._core.active}get error(){return this._core.error}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}requestPermission(){return this._core.requestPermission()}start(e){return this._core.start(e??this.threshold)}stop(){this._core.stop()}connectedCallback(){!function(e){const t=e.constructor?.wcBindable,r=t?.inputs;if(void 0!==r)for(const t of r){const r=t.name;if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!o(e,r))continue;const s=e,n=s[r];delete s[r],s[r]=n}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}customElements.get(e.tagNames.idle)||
|
|
1
|
+
const e={tagNames:{idle:"wcs-idle"}},t="capability-missing",r="not-allowed",s="idle-error";class n extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"userState",event:"wcs-idle:change",semantics:"state",getter:e=>e.detail.userState},{name:"screenState",event:"wcs-idle:change",semantics:"state",getter:e=>e.detail.screenState},{name:"active",event:"wcs-idle:change",semantics:"state",getter:e=>"active"===e.detail.userState},{name:"error",event:"wcs-idle:error",semantics:"state"},{name:"errorInfo",event:"wcs-idle:error-info-changed",semantics:"state"}],commands:[{name:"requestPermission",async:!0},{name:"start",async:!0},{name:"stop"}]};_target;_userState=null;_screenState=null;_error=null;_errorInfo=null;_detector=null;_abortController=null;_gen=0;_ready=Promise.resolve();constructor(e){super(),this._target=e??this}get ready(){return this._ready}get userState(){return this._userState}get screenState(){return this._screenState}get active(){return"active"===this._userState}get error(){return this._error}get errorInfo(){return this._errorInfo}observe(){return this._ready}dispose(){this.stop()}_api(){const e=globalThis;return"function"==typeof e.IdleDetector?e.IdleDetector:void 0}_setState(e,t){this._userState===e&&this._screenState===t||(this._userState=e,this._screenState=t,this._target.dispatchEvent(new CustomEvent("wcs-idle:change",{detail:{userState:e,screenState:t},bubbles:!0})))}_setError(e,n){this._error!==e&&(this._error=e,this._commitErrorInfo(null===e?null:function(e,n){return"unsupported"===e?{code:t,phase:"probe",recoverable:!1,message:n}:"NotAllowedError"===e?{code:r,phase:"start",recoverable:!1,message:n}:{code:s,phase:"execute",recoverable:!1,message:n}}(n,this._errorInfoMessage(e))),this._target.dispatchEvent(new CustomEvent("wcs-idle:error",{detail:e,bubbles:!0})))}_errorInfoMessage(e){const t=null!=e&&"object"==typeof e&&"error"in e?e.error:e;return"string"==typeof t?.message?t.message:String(t)}_commitErrorInfo(e){this._errorInfo=e,this._target.dispatchEvent(new CustomEvent("wcs-idle:error-info-changed",{detail:e,bubbles:!0}))}async requestPermission(){const e=this._api();if(!e)return this._setError({message:"IdleDetector is not supported in this browser"},"unsupported"),"denied";try{const t=await e.requestPermission();return this._setError(null),"granted"===t?"granted":"denied"}catch(e){return this._setError({error:e},e?.name),"denied"}}async start(e=6e4){this.stop();const t=this._api();if(!t)return void this._setError({message:"IdleDetector is not supported in this browser"},"unsupported");const r=new AbortController;this._abortController=r;const s=++this._gen;try{const n=new t;if(n.addEventListener("change",this._onChange),this._detector=n,await n.start({threshold:e,signal:r.signal}),s!==this._gen)return;this._setError(null),this._setState(n.userState,n.screenState)}catch(e){if(s!==this._gen)return;this._detector?.removeEventListener("change",this._onChange),this._detector=null,this._abortController=null,this._setError({error:e},e?.name)}}stop(){this._gen++,this._abortController?.abort(),this._abortController=null,this._detector&&(this._detector.removeEventListener("change",this._onChange),this._detector=null)}_onChange=e=>{const t=e.target;this._setState(t.userState,t.screenState)}}function o(e,t){let r=Object.getPrototypeOf(e);for(;null!==r;){const e=Object.getOwnPropertyDescriptor(r,t);if(void 0!==e)return"function"==typeof e.get||"function"==typeof e.set;r=Object.getPrototypeOf(r)}return!1}class i extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...n.wcBindable,inputs:[{name:"threshold",attribute:"threshold"}],commands:n.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new n(this),this._internals=this._initInternals(),this._wireStates({"wcs-idle:change":e=>({active:"active"===e.userState}),"wcs-idle:error":e=>({error:null!=e})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const e=this.attachInternals();return e.states.add("wcs-probe"),e.states.delete("wcs-probe"),e}catch{return null}}_wireStates(e){if(null===this._internals)return;const t=this._internals.states;for(const[r,s]of Object.entries(e))this.addEventListener(r,e=>{const r=this.hasAttribute("debug-states");for(const[n,o]of Object.entries(s(e.detail))){try{o?t.add(n):t.delete(n)}catch{}r&&this.toggleAttribute(`data-wcs-state-${n}`,o)}})}get threshold(){const e=this.getAttribute("threshold");if(null===e||""===e.trim())return 6e4;const t=Number(e);return Number.isFinite(t)?t:6e4}set threshold(e){this.setAttribute("threshold",String(e))}get userState(){return this._core.userState}get screenState(){return this._core.screenState}get active(){return this._core.active}get error(){return this._core.error}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}requestPermission(){return this._core.requestPermission()}start(e){return this._core.start(e??this.threshold)}stop(){this._core.stop()}connectedCallback(){!function(e){const t=e.constructor?.wcBindable,r=t?.inputs;if(void 0!==r)for(const t of r){const r=t.name;if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!o(e,r))continue;const s=e,n=s[r];delete s[r],s[r]=n}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}var a;!function(t=customElements){t.get(e.tagNames.idle)||t.define(e.tagNames.idle,i)}(a);
|
|
2
2
|
//# sourceMappingURL=auto.min.js.map
|
package/dist/auto.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto.min.js","sources":["../src/config.ts","../src/core/idleCapabilities.ts","../src/core/IdleCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Idle.ts","../src/registerComponents.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n idle: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n idle: \"wcs-idle\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\nexport function setConfig(partialConfig: IWritableConfig): void {\n if (partialConfig.tagNames) {\n Object.assign(_config.tagNames, partialConfig.tagNames);\n }\n frozenConfig = null;\n}\n","/**\n * idleCapabilities.ts\n *\n * Idle Detection node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。idle は requestPermission()/start()/stop() の単一コマンド経路で、競合する\n * operation を持たない(2 回目の start() は前を stop() してから開始する supersede)ため\n * lane は持たず、error taxonomy(errorInfo)のみを採用する。\n *\n * この node の `_setError` は 2 形態の入力を受ける:\n * 1. synthetic な非対応マーカー(`{ message: \"IdleDetector is not supported…\" }`、\n * `.name` 無し)— `globalThis.IdleDetector` 不在。\n * 2. caught された rejection を包んだ `{ error: e }`(`e.name` が実 Error.name)。\n * 両者を message coupling 無しに弁別するため、呼び出し側が明示的な `name` ヒントを渡す\n * (storage の `deriveStorageErrorInfo(error, name)` / screen-orientation と同じ\n * discriminator 技法)。非対応経路は `\"unsupported\"` を、caught 経路は wrap した\n * `e?.name` を渡す。\n *\n * requestPermission()/start() の実 rejection 名は spec のとおり gesture 文脈外 /\n * 権限未許可で `NotAllowedError`。それ以外(生の Error / TypeError(threshold 不正)/\n * `.name` 欠如の nullish reject 等)は一括して `idle-error`。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した idle error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_IDLE_ERROR_CODE = {\n /** Idle Detection API 非対応(`globalThis.IdleDetector` 不在)。 */\n CapabilityMissing: \"capability-missing\",\n /** `NotAllowedError` — 権限拒否 / user-gesture 文脈外。retry では回復しない。 */\n NotAllowed: \"not-allowed\",\n /** その他の requestPermission()/start() 失敗(生 throw / TypeError / nullish reject 等)。 */\n IdleError: \"idle-error\",\n} as const;\n\n/**\n * idle の失敗を serializable な error taxonomy に写す。\n *\n * `name` は呼び出し側が渡す discriminator:synthetic 非対応なら `\"unsupported\"`、\n * caught 例外なら wrap した `e?.name`(生の非 Error / nullish reject では `undefined`)。\n * `message` は wrap を解いた下位値から抽出済みの文言(非対応なら synthetic の message)。\n *\n * - `\"unsupported\"` は利用直前の能力欠如 → phase=\"probe\" / capability-missing。\n * - `NotAllowedError` は requestPermission()/start() の権限ゲート失敗 → phase=\"start\" /\n * not-allowed / recoverable=false(gesture 違反と実 \"denied\" は区別しない設計 §4.1)。\n * - それ以外(生の throw、TypeError、`.name` 欠如等)は実行中の失敗 → phase=\"execute\" /\n * idle-error / recoverable=false。\n */\nexport function deriveIdleErrorInfo(name: string | undefined, message: string): WcsIoErrorInfo {\n if (name === \"unsupported\") {\n return { code: WCS_IDLE_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (name === \"NotAllowedError\") {\n return { code: WCS_IDLE_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_IDLE_ERROR_CODE.IdleError, phase: \"execute\", recoverable: false, message };\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveIdleErrorInfo } from \"./idleCapabilities.js\";\n\ninterface IdleDetectorLike extends EventTarget {\n userState: IdleUserState;\n screenState: IdleScreenState;\n start(options: { threshold: number; signal: AbortSignal }): Promise<void>;\n}\n\ninterface IdleDetectorCtor {\n new (): IdleDetectorLike;\n requestPermission(): Promise<\"granted\" | \"denied\">;\n}\n\nconst MIN_THRESHOLD = 60000;\n\n/**\n * Headless Idle Detection primitive. A thin, framework-agnostic wrapper around\n * `IdleDetector` exposed through the wc-bindable protocol.\n *\n * Reference implementation for batch2's \"gesture-gated permission\" archetype\n * (docs/idle-detection-tag-design.md). `requestPermission()` wraps the static,\n * user-gesture-gated `IdleDetector.requestPermission()` — this Core never\n * calls it automatically; the caller must invoke it from within a real\n * gesture handler.\n *\n * Deliberately does NOT track the 4-value permission state (prompt/granted/\n * denied/unsupported) itself: `navigator.permissions.query({name:\n * \"idle-detection\"})` exists, so compose with `<wcs-permission\n * name=\"idle-detection\">` for that instead (§0). This Core only exposes the\n * actual idle state (userState/screenState) plus the one-time\n * requestPermission()/start()/stop() actions.\n */\nexport class IdleCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"userState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.userState },\n { name: \"screenState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.screenState },\n {\n name: \"active\",\n event: \"wcs-idle:change\",\n semantics: \"state\",\n getter: (e: Event) => (e as CustomEvent).detail.userState === \"active\",\n },\n // never-throw (§3.6): requestPermission()/start() failures land here\n // instead of rejecting/throwing. Mirrors every other bidirectional IO\n // node in this batch (fetch, share, screen-orientation).\n { name: \"error\", event: \"wcs-idle:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error` (capability-missing / not-allowed\n // / idle-error); the existing `error` property/event are unchanged. Fires\n // wcs-idle:error-info-changed. No lane — requestPermission()/start()/stop() form a\n // single command path (a 2nd start() supersedes the 1st), not competing operations.\n { name: \"errorInfo\", event: \"wcs-idle:error-info-changed\", semantics: \"state\" },\n ],\n // No `inputs`: the Core has no settable `threshold` state — `threshold` is a\n // per-call argument to `start(threshold)`, not a property/setter. The DOM-driven\n // `threshold` input surface belongs to the Shell (which declares it and backs it\n // with the `threshold` attribute), mirroring geolocation/intersection where the\n // Core declares no inputs and the Shell adds them.\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\", async: true },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _userState: IdleUserState | null = null;\n private _screenState: IdleScreenState | null = null;\n private _error: any = null;\n // Additive failure taxonomy, kept strictly in sync with `_error` (derived on\n // every _setError, cleared to null when error clears). The two transition together.\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _detector: IdleDetectorLike | null = null;\n private _abortController: AbortController | null = null;\n\n // Generation guard (§3.4): bumped on dispose()/stop() and each start().\n private _gen = 0;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate (docs/idle-detection-tag-design.md §7).\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get userState(): IdleUserState | null {\n return this._userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._screenState;\n }\n\n get active(): boolean {\n return this._userState === \"active\";\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-idle:error-info-changed`), derived from `error`; the existing `error`\n * property/event are unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n // Lifecycle (§3.5). observe() is a synchronous no-op: unlike most IO nodes,\n // this Core deliberately does NOT auto-start on connect (§6) — permission\n // is gesture-gated, so attempting start() before it is granted is\n // guaranteed to fail.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _api(): IdleDetectorCtor | undefined {\n const g = globalThis as any;\n return typeof g.IdleDetector === \"function\" ? g.IdleDetector : undefined;\n }\n\n private _setState(userState: IdleUserState, screenState: IdleScreenState): void {\n if (this._userState === userState && this._screenState === screenState) return;\n this._userState = userState;\n this._screenState = screenState;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:change\", {\n detail: { userState, screenState },\n bubbles: true,\n }));\n }\n\n // `name` is the discriminator for the additive `errorInfo` taxonomy only (it\n // stays out of the public `error` shape): the synthetic unsupported marker has\n // no `.name`, so the unsupported call sites pass an explicit `\"unsupported\"`\n // hint (storage/screen-orientation-style — avoids coupling to `error.message`),\n // while the caught paths pass the wrapped rejection's `Error.name` (`e?.name`).\n // `null` clears (no name).\n private _setError(error: any, name?: string): void {\n if (this._error === error) return;\n this._error = error;\n // Keep the additive `errorInfo` taxonomy in sync with `error`: derive from the\n // discriminator + extracted message (or null on clear). Fires before the `error`\n // event so an observer binding both sees the classification first, mirroring the\n // io-node family.\n this._commitErrorInfo(error === null ? null : deriveIdleErrorInfo(name, this._errorInfoMessage(error)));\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Extract a serializable string message for `errorInfo` WITHOUT normalizing the\n // public `error` shape. The public error is either the synthetic `{ message }`\n // (unsupported) or a wrapped `{ error: e }` (a caught rejection). For the wrapped\n // form the meaningful message lives on `e`, so unwrap one level before reading\n // `.message`; a non-conformant / nullish value (e.g. `Promise.reject(undefined)`)\n // falls back to `String(...)` so it still classifies instead of throwing\n // (never-throw §3.6).\n private _errorInfoMessage(error: any): string {\n const src = error != null && typeof error === \"object\" && \"error\" in error ? error.error : error;\n return typeof src?.message === \"string\" ? src.message : String(src);\n }\n\n // Called only from _setError (which already same-value-guards on the error\n // reference), so errorInfo transitions exactly when error does — no separate\n // guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps the static, user-gesture-gated `IdleDetector.requestPermission()`.\n * MUST be invoked from within a real user gesture handler by the caller —\n * this Core cannot manufacture one. never-throw: a gesture-context\n * rejection resolves to `\"denied\"` and lands in `error`. Gesture violation\n * and an actual \"denied\" outcome are not distinguished — both mean \"not\n * usable right now\" (§4.1).\n */\n async requestPermission(): Promise<\"granted\" | \"denied\"> {\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return \"denied\";\n }\n try {\n const result = await Ctor.requestPermission();\n // Symmetric with start()'s success path: any settled (non-throwing)\n // outcome — granted or a plain \"denied\" — supersedes a stale error from\n // an earlier attempt (e.g. a prior gesture-context rejection).\n this._setError(null);\n return result === \"granted\" ? \"granted\" : \"denied\";\n } catch (e: any) {\n this._setError({ error: e }, e?.name);\n return \"denied\";\n }\n }\n\n /**\n * Start an idle-detection session. `threshold` (ms) must be >= 60000 per\n * spec — not validated here (§3): an out-of-range value is left to the\n * browser's own TypeError, which never-throw absorbs into `error`.\n */\n async start(threshold: number = MIN_THRESHOLD): Promise<void> {\n this.stop(); // supersede any in-flight session (mirrors FetchCore's \"cancel then start\")\n\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return;\n }\n\n const ac = new AbortController();\n this._abortController = ac;\n const gen = ++this._gen;\n\n try {\n const detector = new Ctor();\n detector.addEventListener(\"change\", this._onChange);\n this._detector = detector;\n await detector.start({ threshold, signal: ac.signal });\n if (gen !== this._gen) return; // stale (stop()/dispose() ran during the await)\n this._setError(null);\n this._setState(detector.userState, detector.screenState);\n } catch (e: any) {\n // No separate AbortError check: stop()/dispose() bump `_gen` *before*\n // calling `ac.abort()` (see stop() below), so a stop()-triggered\n // AbortError always has a stale `gen` here and is already caught by\n // the check above. The signal is private and never exposed, so an\n // AbortError from any other source cannot occur.\n if (gen !== this._gen) return;\n // Tear down the failed session's listener/controller (mirrors stop()):\n // without this, the failed `_detector` stays wired to `_onChange` and a\n // later `change` on that same (never-truly-started) instance would\n // still write state, contradicting the error just recorded.\n this._detector?.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n this._abortController = null;\n this._setError({ error: e }, e?.name);\n }\n }\n\n /** Stop the current session (if any) and detach its listener. Safe to call when not started. */\n stop(): void {\n this._gen++;\n this._abortController?.abort();\n this._abortController = null;\n if (this._detector) {\n this._detector.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n }\n }\n\n private _onChange = (event: Event): void => {\n const detector = event.target as IdleDetectorLike;\n this._setState(detector.userState, detector.screenState);\n };\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n for (const input of inputs) {\n const name = input.name;\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { IdleCore } from \"../core/IdleCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-idle>` — declarative Idle Detection API primitive.\n *\n * Does NOT auto-start on connect (docs/idle-detection-tag-design.md §6): the\n * permission gate sits in front of `start()`, so an unconditional\n * connectedCallback start would be guaranteed to fail before permission is\n * granted. Callers drive `requestPermission()` → `start()` explicitly, e.g.\n * from a click handler.\n *\n * Compose with `<wcs-permission name=\"idle-detection\">` for prompt/granted/\n * denied status — this Shell only exposes the actual idle state.\n */\nexport class WcsIdle extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...IdleCore.wcBindable,\n inputs: [\n { name: \"threshold\", attribute: \"threshold\" },\n ],\n // Core の commands をそのまま継承(単一情報源)。\n commands: IdleCore.wcBindable.commands,\n };\n\n private _core: IdleCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new IdleCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-idle:change\": (d) => ({ active: d.userState === \"active\" }),\n \"wcs-idle:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1/§3.4): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Attribute accessors ---\n\n /**\n * Minimum idle time (ms) before `userState` becomes `\"idle\"`. This value is\n * read only at `start()` time — there is no `attributeChangedCallback`\n * (deliberately not declared in `observedAttributes`, mirroring\n * `<wcs-gyroscope>`'s `frequency`), so mutating the attribute/property on an\n * already-running session has no effect until the caller `stop()`s and\n * `start()`s again.\n */\n get threshold(): number {\n const attr = this.getAttribute(\"threshold\");\n // An absent, empty, or whitespace-only attribute all mean \"no value\n // supplied\" and must fall back to the default — without this check,\n // `Number(\"\")`/`Number(\" \")` coerce to `0` (finite), which would slip\n // past the `Number.isFinite` fallback below and silently return `0`\n // instead of the documented 60000ms default.\n if (attr === null || attr.trim() === \"\") return 60000;\n const n = Number(attr);\n return Number.isFinite(n) ? n : 60000;\n }\n\n set threshold(value: number) {\n this.setAttribute(\"threshold\", String(value));\n }\n\n // --- Core delegated getters ---\n\n get userState(): IdleUserState | null {\n return this._core.userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._core.screenState;\n }\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands (delegated to Core) ---\n\n requestPermission(): Promise<\"granted\" | \"denied\"> {\n return this._core.requestPermission();\n }\n\n start(threshold?: number): Promise<void> {\n return this._core.start(threshold ?? this.threshold);\n }\n\n stop(): void {\n this._core.stop();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n // No auto-start (§6) — observe() is a synchronous no-op, kept only for\n // API uniformity with other IO nodes' lifecycle.\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { WcsIdle } from \"./components/Idle.js\";\nimport { config } from \"./config.js\";\n\nexport function registerComponents(): void {\n if (!customElements.get(config.tagNames.idle)) {\n customElements.define(config.tagNames.idle, WcsIdle);\n }\n}\n"],"names":["config","tagNames","idle","WCS_IDLE_ERROR_CODE","IdleCore","EventTarget","static","protocol","version","properties","name","event","semantics","getter","e","detail","userState","screenState","commands","async","_target","_userState","_screenState","_error","_errorInfo","_detector","_abortController","_gen","_ready","Promise","resolve","constructor","target","super","this","ready","active","error","errorInfo","observe","dispose","stop","_api","g","globalThis","IdleDetector","undefined","_setState","dispatchEvent","CustomEvent","bubbles","_setError","_commitErrorInfo","message","code","phase","recoverable","deriveIdleErrorInfo","_errorInfoMessage","src","String","info","requestPermission","Ctor","result","start","threshold","ac","AbortController","gen","detector","addEventListener","_onChange","signal","removeEventListener","abort","hasAccessorOnPrototype","proto","Object","getPrototypeOf","descriptor","getOwnPropertyDescriptor","get","set","WcsIdle","HTMLElement","wcBindable","inputs","attribute","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","d","debugStates","states","attachInternals","internals","add","delete","map","toStates","entries","debug","hasAttribute","on","toggleAttribute","attr","getAttribute","trim","n","Number","isFinite","value","setAttribute","connectedCallbackPromise","connectedCallback","element","declaration","input","prototype","hasOwnProperty","call","record","upgradeProperties","style","display","disconnectedCallback","customElements","define"],"mappings":"AAQA,MA0BaA,EA1BoB,CAC/BC,SAAU,CACRC,KAAM,aCgBGC,EAEQ,qBAFRA,EAIC,cAJDA,EAMA,aCEP,MAAOC,UAAiBC,YAC5BC,kBAAiC,CAC/BC,SAAU,cACVC,QAAS,EACTC,WAAY,CACV,CAAEC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,GACZhF,KAAKiF,aAAa,YAAavD,OAAOsD,GACxC,CAIA,aAAIlG,GACF,OAAOkB,KAAKuD,MAAMzE,SACpB,CAEA,eAAIC,GACF,OAAOiB,KAAKuD,MAAMxE,WACpB,CAEA,UAAImB,GACF,OAAOF,KAAKuD,MAAMrD,MACpB,CAEA,SAAIC,GACF,OAAOH,KAAKuD,MAAMpD,KACpB,CAEA,aAAIC,GACF,OAAOJ,KAAKuD,MAAMnD,SACpB,CAEA,4BAAI8E,GACF,OAAOlF,KAAKwD,yBACd,CAIA,iBAAA5B,GACE,OAAO5B,KAAKuD,MAAM3B,mBACpB,CAEA,KAAAG,CAAMC,GACJ,OAAOhC,KAAKuD,MAAMxB,MAAMC,GAAahC,KAAKgC,UAC5C,CAEA,IAAAzB,GACEP,KAAKuD,MAAMhD,MACb,CAIA,iBAAA4E,ID1GI,SAA4BC,GAChC,MAAMC,EAAeD,EAA2DvF,aAAauD,WACvFC,EAASgC,GAAahC,OAC5B,QAAezC,IAAXyC,EACJ,IAAK,MAAMiC,KAASjC,EAAQ,CAC1B,MAAM7E,EAAO8G,EAAM9G,KACnB,IAAKoE,OAAO2C,UAAUC,eAAeC,KAAKL,EAAS5G,GAAO,SAC1D,IAAKkE,EAAuB0C,EAAS5G,GAAO,SAC5C,MAAMkH,EAASN,EACTJ,EAAQU,EAAOlH,UACdkH,EAAOlH,GACdkH,EAAOlH,GAAQwG,CACjB,CACF,CC+FIW,CAAkB3F,MAClBA,KAAK4F,MAAMC,QAAU,OAGrB7F,KAAKwD,0BAA4BxD,KAAKuD,MAAMlD,SAC9C,CAEA,oBAAAyF,GACE9F,KAAKuD,MAAMjD,SACb,EC/JKyF,eAAe/C,IAAIlF,EAAOC,SAASC,OACtC+H,eAAeC,OAAOlI,EAAOC,SAASC,KAAMkF"}
|
|
1
|
+
{"version":3,"file":"auto.min.js","sources":["../src/config.ts","../src/core/idleCapabilities.ts","../src/core/IdleCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Idle.ts","../src/bootstrapIdle.ts","../src/registerComponents.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n idle: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n idle: \"wcs-idle\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\nexport function setConfig(partialConfig: IWritableConfig): void {\n if (partialConfig.tagNames) {\n Object.assign(_config.tagNames, partialConfig.tagNames);\n }\n frozenConfig = null;\n}\n","/**\n * idleCapabilities.ts\n *\n * Idle Detection node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。idle は requestPermission()/start()/stop() の単一コマンド経路で、競合する\n * operation を持たない(2 回目の start() は前を stop() してから開始する supersede)ため\n * lane は持たず、error taxonomy(errorInfo)のみを採用する。\n *\n * この node の `_setError` は 2 形態の入力を受ける:\n * 1. synthetic な非対応マーカー(`{ message: \"IdleDetector is not supported…\" }`、\n * `.name` 無し)— `globalThis.IdleDetector` 不在。\n * 2. caught された rejection を包んだ `{ error: e }`(`e.name` が実 Error.name)。\n * 両者を message coupling 無しに弁別するため、呼び出し側が明示的な `name` ヒントを渡す\n * (storage の `deriveStorageErrorInfo(error, name)` / screen-orientation と同じ\n * discriminator 技法)。非対応経路は `\"unsupported\"` を、caught 経路は wrap した\n * `e?.name` を渡す。\n *\n * requestPermission()/start() の実 rejection 名は spec のとおり gesture 文脈外 /\n * 権限未許可で `NotAllowedError`。それ以外(生の Error / TypeError(threshold 不正)/\n * `.name` 欠如の nullish reject 等)は一括して `idle-error`。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した idle error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_IDLE_ERROR_CODE = {\n /** Idle Detection API 非対応(`globalThis.IdleDetector` 不在)。 */\n CapabilityMissing: \"capability-missing\",\n /** `NotAllowedError` — 権限拒否 / user-gesture 文脈外。retry では回復しない。 */\n NotAllowed: \"not-allowed\",\n /** その他の requestPermission()/start() 失敗(生 throw / TypeError / nullish reject 等)。 */\n IdleError: \"idle-error\",\n} as const;\n\n/**\n * idle の失敗を serializable な error taxonomy に写す。\n *\n * `name` は呼び出し側が渡す discriminator:synthetic 非対応なら `\"unsupported\"`、\n * caught 例外なら wrap した `e?.name`(生の非 Error / nullish reject では `undefined`)。\n * `message` は wrap を解いた下位値から抽出済みの文言(非対応なら synthetic の message)。\n *\n * - `\"unsupported\"` は利用直前の能力欠如 → phase=\"probe\" / capability-missing。\n * - `NotAllowedError` は requestPermission()/start() の権限ゲート失敗 → phase=\"start\" /\n * not-allowed / recoverable=false(gesture 違反と実 \"denied\" は区別しない設計 §4.1)。\n * - それ以外(生の throw、TypeError、`.name` 欠如等)は実行中の失敗 → phase=\"execute\" /\n * idle-error / recoverable=false。\n */\nexport function deriveIdleErrorInfo(name: string | undefined, message: string): WcsIoErrorInfo {\n if (name === \"unsupported\") {\n return { code: WCS_IDLE_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (name === \"NotAllowedError\") {\n return { code: WCS_IDLE_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_IDLE_ERROR_CODE.IdleError, phase: \"execute\", recoverable: false, message };\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveIdleErrorInfo } from \"./idleCapabilities.js\";\n\ninterface IdleDetectorLike extends EventTarget {\n userState: IdleUserState;\n screenState: IdleScreenState;\n start(options: { threshold: number; signal: AbortSignal }): Promise<void>;\n}\n\ninterface IdleDetectorCtor {\n new (): IdleDetectorLike;\n requestPermission(): Promise<\"granted\" | \"denied\">;\n}\n\nconst MIN_THRESHOLD = 60000;\n\n/**\n * Headless Idle Detection primitive. A thin, framework-agnostic wrapper around\n * `IdleDetector` exposed through the wc-bindable protocol.\n *\n * Reference implementation for batch2's \"gesture-gated permission\" archetype\n * (docs/idle-detection-tag-design.md). `requestPermission()` wraps the static,\n * user-gesture-gated `IdleDetector.requestPermission()` — this Core never\n * calls it automatically; the caller must invoke it from within a real\n * gesture handler.\n *\n * Deliberately does NOT track the 4-value permission state (prompt/granted/\n * denied/unsupported) itself: `navigator.permissions.query({name:\n * \"idle-detection\"})` exists, so compose with `<wcs-permission\n * name=\"idle-detection\">` for that instead (§0). This Core only exposes the\n * actual idle state (userState/screenState) plus the one-time\n * requestPermission()/start()/stop() actions.\n */\nexport class IdleCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"userState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.userState },\n { name: \"screenState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.screenState },\n {\n name: \"active\",\n event: \"wcs-idle:change\",\n semantics: \"state\",\n getter: (e: Event) => (e as CustomEvent).detail.userState === \"active\",\n },\n // never-throw (§3.6): requestPermission()/start() failures land here\n // instead of rejecting/throwing. Mirrors every other bidirectional IO\n // node in this batch (fetch, share, screen-orientation).\n { name: \"error\", event: \"wcs-idle:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error` (capability-missing / not-allowed\n // / idle-error); the existing `error` property/event are unchanged. Fires\n // wcs-idle:error-info-changed. No lane — requestPermission()/start()/stop() form a\n // single command path (a 2nd start() supersedes the 1st), not competing operations.\n { name: \"errorInfo\", event: \"wcs-idle:error-info-changed\", semantics: \"state\" },\n ],\n // No `inputs`: the Core has no settable `threshold` state — `threshold` is a\n // per-call argument to `start(threshold)`, not a property/setter. The DOM-driven\n // `threshold` input surface belongs to the Shell (which declares it and backs it\n // with the `threshold` attribute), mirroring geolocation/intersection where the\n // Core declares no inputs and the Shell adds them.\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\", async: true },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _userState: IdleUserState | null = null;\n private _screenState: IdleScreenState | null = null;\n private _error: any = null;\n // Additive failure taxonomy, kept strictly in sync with `_error` (derived on\n // every _setError, cleared to null when error clears). The two transition together.\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _detector: IdleDetectorLike | null = null;\n private _abortController: AbortController | null = null;\n\n // Generation guard (§3.4): bumped on dispose()/stop() and each start().\n private _gen = 0;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate (docs/idle-detection-tag-design.md §7).\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get userState(): IdleUserState | null {\n return this._userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._screenState;\n }\n\n get active(): boolean {\n return this._userState === \"active\";\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-idle:error-info-changed`), derived from `error`; the existing `error`\n * property/event are unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n // Lifecycle (§3.5). observe() is a synchronous no-op: unlike most IO nodes,\n // this Core deliberately does NOT auto-start on connect (§6) — permission\n // is gesture-gated, so attempting start() before it is granted is\n // guaranteed to fail.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _api(): IdleDetectorCtor | undefined {\n const g = globalThis as any;\n return typeof g.IdleDetector === \"function\" ? g.IdleDetector : undefined;\n }\n\n private _setState(userState: IdleUserState, screenState: IdleScreenState): void {\n if (this._userState === userState && this._screenState === screenState) return;\n this._userState = userState;\n this._screenState = screenState;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:change\", {\n detail: { userState, screenState },\n bubbles: true,\n }));\n }\n\n // `name` is the discriminator for the additive `errorInfo` taxonomy only (it\n // stays out of the public `error` shape): the synthetic unsupported marker has\n // no `.name`, so the unsupported call sites pass an explicit `\"unsupported\"`\n // hint (storage/screen-orientation-style — avoids coupling to `error.message`),\n // while the caught paths pass the wrapped rejection's `Error.name` (`e?.name`).\n // `null` clears (no name).\n private _setError(error: any, name?: string): void {\n if (this._error === error) return;\n this._error = error;\n // Keep the additive `errorInfo` taxonomy in sync with `error`: derive from the\n // discriminator + extracted message (or null on clear). Fires before the `error`\n // event so an observer binding both sees the classification first, mirroring the\n // io-node family.\n this._commitErrorInfo(error === null ? null : deriveIdleErrorInfo(name, this._errorInfoMessage(error)));\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Extract a serializable string message for `errorInfo` WITHOUT normalizing the\n // public `error` shape. The public error is either the synthetic `{ message }`\n // (unsupported) or a wrapped `{ error: e }` (a caught rejection). For the wrapped\n // form the meaningful message lives on `e`, so unwrap one level before reading\n // `.message`; a non-conformant / nullish value (e.g. `Promise.reject(undefined)`)\n // falls back to `String(...)` so it still classifies instead of throwing\n // (never-throw §3.6).\n private _errorInfoMessage(error: any): string {\n const src = error != null && typeof error === \"object\" && \"error\" in error ? error.error : error;\n return typeof src?.message === \"string\" ? src.message : String(src);\n }\n\n // Called only from _setError (which already same-value-guards on the error\n // reference), so errorInfo transitions exactly when error does — no separate\n // guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps the static, user-gesture-gated `IdleDetector.requestPermission()`.\n * MUST be invoked from within a real user gesture handler by the caller —\n * this Core cannot manufacture one. never-throw: a gesture-context\n * rejection resolves to `\"denied\"` and lands in `error`. Gesture violation\n * and an actual \"denied\" outcome are not distinguished — both mean \"not\n * usable right now\" (§4.1).\n */\n async requestPermission(): Promise<\"granted\" | \"denied\"> {\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return \"denied\";\n }\n try {\n const result = await Ctor.requestPermission();\n // Symmetric with start()'s success path: any settled (non-throwing)\n // outcome — granted or a plain \"denied\" — supersedes a stale error from\n // an earlier attempt (e.g. a prior gesture-context rejection).\n this._setError(null);\n return result === \"granted\" ? \"granted\" : \"denied\";\n } catch (e: any) {\n this._setError({ error: e }, e?.name);\n return \"denied\";\n }\n }\n\n /**\n * Start an idle-detection session. `threshold` (ms) must be >= 60000 per\n * spec — not validated here (§3): an out-of-range value is left to the\n * browser's own TypeError, which never-throw absorbs into `error`.\n */\n async start(threshold: number = MIN_THRESHOLD): Promise<void> {\n this.stop(); // supersede any in-flight session (mirrors FetchCore's \"cancel then start\")\n\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return;\n }\n\n const ac = new AbortController();\n this._abortController = ac;\n const gen = ++this._gen;\n\n try {\n const detector = new Ctor();\n detector.addEventListener(\"change\", this._onChange);\n this._detector = detector;\n await detector.start({ threshold, signal: ac.signal });\n if (gen !== this._gen) return; // stale (stop()/dispose() ran during the await)\n this._setError(null);\n this._setState(detector.userState, detector.screenState);\n } catch (e: any) {\n // No separate AbortError check: stop()/dispose() bump `_gen` *before*\n // calling `ac.abort()` (see stop() below), so a stop()-triggered\n // AbortError always has a stale `gen` here and is already caught by\n // the check above. The signal is private and never exposed, so an\n // AbortError from any other source cannot occur.\n if (gen !== this._gen) return;\n // Tear down the failed session's listener/controller (mirrors stop()):\n // without this, the failed `_detector` stays wired to `_onChange` and a\n // later `change` on that same (never-truly-started) instance would\n // still write state, contradicting the error just recorded.\n this._detector?.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n this._abortController = null;\n this._setError({ error: e }, e?.name);\n }\n }\n\n /** Stop the current session (if any) and detach its listener. Safe to call when not started. */\n stop(): void {\n this._gen++;\n this._abortController?.abort();\n this._abortController = null;\n if (this._detector) {\n this._detector.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n }\n }\n\n private _onChange = (event: Event): void => {\n const detector = event.target as IdleDetectorLike;\n this._setState(detector.userState, detector.screenState);\n };\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n for (const input of inputs) {\n const name = input.name;\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { IdleCore } from \"../core/IdleCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-idle>` — declarative Idle Detection API primitive.\n *\n * Does NOT auto-start on connect (docs/idle-detection-tag-design.md §6): the\n * permission gate sits in front of `start()`, so an unconditional\n * connectedCallback start would be guaranteed to fail before permission is\n * granted. Callers drive `requestPermission()` → `start()` explicitly, e.g.\n * from a click handler.\n *\n * Compose with `<wcs-permission name=\"idle-detection\">` for prompt/granted/\n * denied status — this Shell only exposes the actual idle state.\n */\nexport class WcsIdle extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...IdleCore.wcBindable,\n inputs: [\n { name: \"threshold\", attribute: \"threshold\" },\n ],\n // Core の commands をそのまま継承(単一情報源)。\n commands: IdleCore.wcBindable.commands,\n };\n\n private _core: IdleCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new IdleCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-idle:change\": (d) => ({ active: d.userState === \"active\" }),\n \"wcs-idle:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1/§3.4): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Attribute accessors ---\n\n /**\n * Minimum idle time (ms) before `userState` becomes `\"idle\"`. This value is\n * read only at `start()` time — there is no `attributeChangedCallback`\n * (deliberately not declared in `observedAttributes`, mirroring\n * `<wcs-gyroscope>`'s `frequency`), so mutating the attribute/property on an\n * already-running session has no effect until the caller `stop()`s and\n * `start()`s again.\n */\n get threshold(): number {\n const attr = this.getAttribute(\"threshold\");\n // An absent, empty, or whitespace-only attribute all mean \"no value\n // supplied\" and must fall back to the default — without this check,\n // `Number(\"\")`/`Number(\" \")` coerce to `0` (finite), which would slip\n // past the `Number.isFinite` fallback below and silently return `0`\n // instead of the documented 60000ms default.\n if (attr === null || attr.trim() === \"\") return 60000;\n const n = Number(attr);\n return Number.isFinite(n) ? n : 60000;\n }\n\n set threshold(value: number) {\n this.setAttribute(\"threshold\", String(value));\n }\n\n // --- Core delegated getters ---\n\n get userState(): IdleUserState | null {\n return this._core.userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._core.screenState;\n }\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands (delegated to Core) ---\n\n requestPermission(): Promise<\"granted\" | \"denied\"> {\n return this._core.requestPermission();\n }\n\n start(threshold?: number): Promise<void> {\n return this._core.start(threshold ?? this.threshold);\n }\n\n stop(): void {\n this._core.stop();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n // No auto-start (§6) — observe() is a synchronous no-op, kept only for\n // API uniformity with other IO nodes' lifecycle.\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapIdle(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n","import { WcsIdle } from \"./components/Idle.js\";\nimport { config } from \"./config.js\";\n\n/**\n * Register this package's tags. Pass a scoped `CustomElementRegistry` to define\n * them for a single shadow tree -- scoped registries do not inherit the global\n * one, so a tree using one needs its own definitions.\n */\nexport function registerComponents(registry: CustomElementRegistry = customElements): void {\n if (!registry.get(config.tagNames.idle)) {\n registry.define(config.tagNames.idle, WcsIdle);\n }\n}\n"],"names":["config","tagNames","idle","WCS_IDLE_ERROR_CODE","IdleCore","EventTarget","static","protocol","version","properties","name","event","semantics","getter","e","detail","userState","screenState","commands","async","_target","_userState","_screenState","_error","_errorInfo","_detector","_abortController","_gen","_ready","Promise","resolve","constructor","target","super","this","ready","active","error","errorInfo","observe","dispose","stop","_api","g","globalThis","IdleDetector","undefined","_setState","dispatchEvent","CustomEvent","bubbles","_setError","_commitErrorInfo","message","code","phase","recoverable","deriveIdleErrorInfo","_errorInfoMessage","src","String","info","requestPermission","Ctor","result","start","threshold","ac","AbortController","gen","detector","addEventListener","_onChange","signal","removeEventListener","abort","hasAccessorOnPrototype","proto","Object","getPrototypeOf","descriptor","getOwnPropertyDescriptor","get","set","WcsIdle","HTMLElement","wcBindable","inputs","attribute","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","d","debugStates","states","attachInternals","internals","add","delete","map","toStates","entries","debug","hasAttribute","on","toggleAttribute","attr","getAttribute","trim","n","Number","isFinite","value","setAttribute","connectedCallbackPromise","connectedCallback","element","declaration","input","prototype","hasOwnProperty","call","record","upgradeProperties","style","display","disconnectedCallback","registry","customElements","define","registerComponents"],"mappings":"AAQA,MA0BaA,EA1BoB,CAC/BC,SAAU,CACRC,KAAM,aCgBGC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OAChC+H,EAASE,OAAOnI,EAAOC,SAASC,KAAMkF,EAE1C,CDJEgD,CAAmBH"}
|
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ interface WcsIdleCoreValues {
|
|
|
83
83
|
*/
|
|
84
84
|
type WcsIdleValues = WcsIdleCoreValues;
|
|
85
85
|
|
|
86
|
-
declare function bootstrapIdle(userConfig?: IWritableConfig): void;
|
|
86
|
+
declare function bootstrapIdle(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void;
|
|
87
87
|
|
|
88
88
|
declare function getConfig(): IConfig;
|
|
89
89
|
|
package/dist/index.esm.js
CHANGED
|
@@ -527,17 +527,22 @@ class WcsIdle extends HTMLElement {
|
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
/**
|
|
531
|
+
* Register this package's tags. Pass a scoped `CustomElementRegistry` to define
|
|
532
|
+
* them for a single shadow tree -- scoped registries do not inherit the global
|
|
533
|
+
* one, so a tree using one needs its own definitions.
|
|
534
|
+
*/
|
|
535
|
+
function registerComponents(registry = customElements) {
|
|
536
|
+
if (!registry.get(config.tagNames.idle)) {
|
|
537
|
+
registry.define(config.tagNames.idle, WcsIdle);
|
|
533
538
|
}
|
|
534
539
|
}
|
|
535
540
|
|
|
536
|
-
function bootstrapIdle(userConfig) {
|
|
541
|
+
function bootstrapIdle(userConfig, registry) {
|
|
537
542
|
if (userConfig) {
|
|
538
543
|
setConfig(userConfig);
|
|
539
544
|
}
|
|
540
|
-
registerComponents();
|
|
545
|
+
registerComponents(registry);
|
|
541
546
|
}
|
|
542
547
|
|
|
543
548
|
export { IdleCore, WCS_IDLE_ERROR_CODE, WcsIdle, bootstrapIdle, getConfig };
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/config.ts","../src/core/idleCapabilities.ts","../src/core/IdleCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Idle.ts","../src/registerComponents.ts","../src/bootstrapIdle.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n idle: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n idle: \"wcs-idle\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\nexport function setConfig(partialConfig: IWritableConfig): void {\n if (partialConfig.tagNames) {\n Object.assign(_config.tagNames, partialConfig.tagNames);\n }\n frozenConfig = null;\n}\n","/**\n * idleCapabilities.ts\n *\n * Idle Detection node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。idle は requestPermission()/start()/stop() の単一コマンド経路で、競合する\n * operation を持たない(2 回目の start() は前を stop() してから開始する supersede)ため\n * lane は持たず、error taxonomy(errorInfo)のみを採用する。\n *\n * この node の `_setError` は 2 形態の入力を受ける:\n * 1. synthetic な非対応マーカー(`{ message: \"IdleDetector is not supported…\" }`、\n * `.name` 無し)— `globalThis.IdleDetector` 不在。\n * 2. caught された rejection を包んだ `{ error: e }`(`e.name` が実 Error.name)。\n * 両者を message coupling 無しに弁別するため、呼び出し側が明示的な `name` ヒントを渡す\n * (storage の `deriveStorageErrorInfo(error, name)` / screen-orientation と同じ\n * discriminator 技法)。非対応経路は `\"unsupported\"` を、caught 経路は wrap した\n * `e?.name` を渡す。\n *\n * requestPermission()/start() の実 rejection 名は spec のとおり gesture 文脈外 /\n * 権限未許可で `NotAllowedError`。それ以外(生の Error / TypeError(threshold 不正)/\n * `.name` 欠如の nullish reject 等)は一括して `idle-error`。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した idle error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_IDLE_ERROR_CODE = {\n /** Idle Detection API 非対応(`globalThis.IdleDetector` 不在)。 */\n CapabilityMissing: \"capability-missing\",\n /** `NotAllowedError` — 権限拒否 / user-gesture 文脈外。retry では回復しない。 */\n NotAllowed: \"not-allowed\",\n /** その他の requestPermission()/start() 失敗(生 throw / TypeError / nullish reject 等)。 */\n IdleError: \"idle-error\",\n} as const;\n\n/**\n * idle の失敗を serializable な error taxonomy に写す。\n *\n * `name` は呼び出し側が渡す discriminator:synthetic 非対応なら `\"unsupported\"`、\n * caught 例外なら wrap した `e?.name`(生の非 Error / nullish reject では `undefined`)。\n * `message` は wrap を解いた下位値から抽出済みの文言(非対応なら synthetic の message)。\n *\n * - `\"unsupported\"` は利用直前の能力欠如 → phase=\"probe\" / capability-missing。\n * - `NotAllowedError` は requestPermission()/start() の権限ゲート失敗 → phase=\"start\" /\n * not-allowed / recoverable=false(gesture 違反と実 \"denied\" は区別しない設計 §4.1)。\n * - それ以外(生の throw、TypeError、`.name` 欠如等)は実行中の失敗 → phase=\"execute\" /\n * idle-error / recoverable=false。\n */\nexport function deriveIdleErrorInfo(name: string | undefined, message: string): WcsIoErrorInfo {\n if (name === \"unsupported\") {\n return { code: WCS_IDLE_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (name === \"NotAllowedError\") {\n return { code: WCS_IDLE_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_IDLE_ERROR_CODE.IdleError, phase: \"execute\", recoverable: false, message };\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveIdleErrorInfo } from \"./idleCapabilities.js\";\n\ninterface IdleDetectorLike extends EventTarget {\n userState: IdleUserState;\n screenState: IdleScreenState;\n start(options: { threshold: number; signal: AbortSignal }): Promise<void>;\n}\n\ninterface IdleDetectorCtor {\n new (): IdleDetectorLike;\n requestPermission(): Promise<\"granted\" | \"denied\">;\n}\n\nconst MIN_THRESHOLD = 60000;\n\n/**\n * Headless Idle Detection primitive. A thin, framework-agnostic wrapper around\n * `IdleDetector` exposed through the wc-bindable protocol.\n *\n * Reference implementation for batch2's \"gesture-gated permission\" archetype\n * (docs/idle-detection-tag-design.md). `requestPermission()` wraps the static,\n * user-gesture-gated `IdleDetector.requestPermission()` — this Core never\n * calls it automatically; the caller must invoke it from within a real\n * gesture handler.\n *\n * Deliberately does NOT track the 4-value permission state (prompt/granted/\n * denied/unsupported) itself: `navigator.permissions.query({name:\n * \"idle-detection\"})` exists, so compose with `<wcs-permission\n * name=\"idle-detection\">` for that instead (§0). This Core only exposes the\n * actual idle state (userState/screenState) plus the one-time\n * requestPermission()/start()/stop() actions.\n */\nexport class IdleCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"userState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.userState },\n { name: \"screenState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.screenState },\n {\n name: \"active\",\n event: \"wcs-idle:change\",\n semantics: \"state\",\n getter: (e: Event) => (e as CustomEvent).detail.userState === \"active\",\n },\n // never-throw (§3.6): requestPermission()/start() failures land here\n // instead of rejecting/throwing. Mirrors every other bidirectional IO\n // node in this batch (fetch, share, screen-orientation).\n { name: \"error\", event: \"wcs-idle:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error` (capability-missing / not-allowed\n // / idle-error); the existing `error` property/event are unchanged. Fires\n // wcs-idle:error-info-changed. No lane — requestPermission()/start()/stop() form a\n // single command path (a 2nd start() supersedes the 1st), not competing operations.\n { name: \"errorInfo\", event: \"wcs-idle:error-info-changed\", semantics: \"state\" },\n ],\n // No `inputs`: the Core has no settable `threshold` state — `threshold` is a\n // per-call argument to `start(threshold)`, not a property/setter. The DOM-driven\n // `threshold` input surface belongs to the Shell (which declares it and backs it\n // with the `threshold` attribute), mirroring geolocation/intersection where the\n // Core declares no inputs and the Shell adds them.\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\", async: true },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _userState: IdleUserState | null = null;\n private _screenState: IdleScreenState | null = null;\n private _error: any = null;\n // Additive failure taxonomy, kept strictly in sync with `_error` (derived on\n // every _setError, cleared to null when error clears). The two transition together.\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _detector: IdleDetectorLike | null = null;\n private _abortController: AbortController | null = null;\n\n // Generation guard (§3.4): bumped on dispose()/stop() and each start().\n private _gen = 0;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate (docs/idle-detection-tag-design.md §7).\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get userState(): IdleUserState | null {\n return this._userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._screenState;\n }\n\n get active(): boolean {\n return this._userState === \"active\";\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-idle:error-info-changed`), derived from `error`; the existing `error`\n * property/event are unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n // Lifecycle (§3.5). observe() is a synchronous no-op: unlike most IO nodes,\n // this Core deliberately does NOT auto-start on connect (§6) — permission\n // is gesture-gated, so attempting start() before it is granted is\n // guaranteed to fail.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _api(): IdleDetectorCtor | undefined {\n const g = globalThis as any;\n return typeof g.IdleDetector === \"function\" ? g.IdleDetector : undefined;\n }\n\n private _setState(userState: IdleUserState, screenState: IdleScreenState): void {\n if (this._userState === userState && this._screenState === screenState) return;\n this._userState = userState;\n this._screenState = screenState;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:change\", {\n detail: { userState, screenState },\n bubbles: true,\n }));\n }\n\n // `name` is the discriminator for the additive `errorInfo` taxonomy only (it\n // stays out of the public `error` shape): the synthetic unsupported marker has\n // no `.name`, so the unsupported call sites pass an explicit `\"unsupported\"`\n // hint (storage/screen-orientation-style — avoids coupling to `error.message`),\n // while the caught paths pass the wrapped rejection's `Error.name` (`e?.name`).\n // `null` clears (no name).\n private _setError(error: any, name?: string): void {\n if (this._error === error) return;\n this._error = error;\n // Keep the additive `errorInfo` taxonomy in sync with `error`: derive from the\n // discriminator + extracted message (or null on clear). Fires before the `error`\n // event so an observer binding both sees the classification first, mirroring the\n // io-node family.\n this._commitErrorInfo(error === null ? null : deriveIdleErrorInfo(name, this._errorInfoMessage(error)));\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Extract a serializable string message for `errorInfo` WITHOUT normalizing the\n // public `error` shape. The public error is either the synthetic `{ message }`\n // (unsupported) or a wrapped `{ error: e }` (a caught rejection). For the wrapped\n // form the meaningful message lives on `e`, so unwrap one level before reading\n // `.message`; a non-conformant / nullish value (e.g. `Promise.reject(undefined)`)\n // falls back to `String(...)` so it still classifies instead of throwing\n // (never-throw §3.6).\n private _errorInfoMessage(error: any): string {\n const src = error != null && typeof error === \"object\" && \"error\" in error ? error.error : error;\n return typeof src?.message === \"string\" ? src.message : String(src);\n }\n\n // Called only from _setError (which already same-value-guards on the error\n // reference), so errorInfo transitions exactly when error does — no separate\n // guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps the static, user-gesture-gated `IdleDetector.requestPermission()`.\n * MUST be invoked from within a real user gesture handler by the caller —\n * this Core cannot manufacture one. never-throw: a gesture-context\n * rejection resolves to `\"denied\"` and lands in `error`. Gesture violation\n * and an actual \"denied\" outcome are not distinguished — both mean \"not\n * usable right now\" (§4.1).\n */\n async requestPermission(): Promise<\"granted\" | \"denied\"> {\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return \"denied\";\n }\n try {\n const result = await Ctor.requestPermission();\n // Symmetric with start()'s success path: any settled (non-throwing)\n // outcome — granted or a plain \"denied\" — supersedes a stale error from\n // an earlier attempt (e.g. a prior gesture-context rejection).\n this._setError(null);\n return result === \"granted\" ? \"granted\" : \"denied\";\n } catch (e: any) {\n this._setError({ error: e }, e?.name);\n return \"denied\";\n }\n }\n\n /**\n * Start an idle-detection session. `threshold` (ms) must be >= 60000 per\n * spec — not validated here (§3): an out-of-range value is left to the\n * browser's own TypeError, which never-throw absorbs into `error`.\n */\n async start(threshold: number = MIN_THRESHOLD): Promise<void> {\n this.stop(); // supersede any in-flight session (mirrors FetchCore's \"cancel then start\")\n\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return;\n }\n\n const ac = new AbortController();\n this._abortController = ac;\n const gen = ++this._gen;\n\n try {\n const detector = new Ctor();\n detector.addEventListener(\"change\", this._onChange);\n this._detector = detector;\n await detector.start({ threshold, signal: ac.signal });\n if (gen !== this._gen) return; // stale (stop()/dispose() ran during the await)\n this._setError(null);\n this._setState(detector.userState, detector.screenState);\n } catch (e: any) {\n // No separate AbortError check: stop()/dispose() bump `_gen` *before*\n // calling `ac.abort()` (see stop() below), so a stop()-triggered\n // AbortError always has a stale `gen` here and is already caught by\n // the check above. The signal is private and never exposed, so an\n // AbortError from any other source cannot occur.\n if (gen !== this._gen) return;\n // Tear down the failed session's listener/controller (mirrors stop()):\n // without this, the failed `_detector` stays wired to `_onChange` and a\n // later `change` on that same (never-truly-started) instance would\n // still write state, contradicting the error just recorded.\n this._detector?.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n this._abortController = null;\n this._setError({ error: e }, e?.name);\n }\n }\n\n /** Stop the current session (if any) and detach its listener. Safe to call when not started. */\n stop(): void {\n this._gen++;\n this._abortController?.abort();\n this._abortController = null;\n if (this._detector) {\n this._detector.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n }\n }\n\n private _onChange = (event: Event): void => {\n const detector = event.target as IdleDetectorLike;\n this._setState(detector.userState, detector.screenState);\n };\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n for (const input of inputs) {\n const name = input.name;\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { IdleCore } from \"../core/IdleCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-idle>` — declarative Idle Detection API primitive.\n *\n * Does NOT auto-start on connect (docs/idle-detection-tag-design.md §6): the\n * permission gate sits in front of `start()`, so an unconditional\n * connectedCallback start would be guaranteed to fail before permission is\n * granted. Callers drive `requestPermission()` → `start()` explicitly, e.g.\n * from a click handler.\n *\n * Compose with `<wcs-permission name=\"idle-detection\">` for prompt/granted/\n * denied status — this Shell only exposes the actual idle state.\n */\nexport class WcsIdle extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...IdleCore.wcBindable,\n inputs: [\n { name: \"threshold\", attribute: \"threshold\" },\n ],\n // Core の commands をそのまま継承(単一情報源)。\n commands: IdleCore.wcBindable.commands,\n };\n\n private _core: IdleCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new IdleCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-idle:change\": (d) => ({ active: d.userState === \"active\" }),\n \"wcs-idle:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1/§3.4): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Attribute accessors ---\n\n /**\n * Minimum idle time (ms) before `userState` becomes `\"idle\"`. This value is\n * read only at `start()` time — there is no `attributeChangedCallback`\n * (deliberately not declared in `observedAttributes`, mirroring\n * `<wcs-gyroscope>`'s `frequency`), so mutating the attribute/property on an\n * already-running session has no effect until the caller `stop()`s and\n * `start()`s again.\n */\n get threshold(): number {\n const attr = this.getAttribute(\"threshold\");\n // An absent, empty, or whitespace-only attribute all mean \"no value\n // supplied\" and must fall back to the default — without this check,\n // `Number(\"\")`/`Number(\" \")` coerce to `0` (finite), which would slip\n // past the `Number.isFinite` fallback below and silently return `0`\n // instead of the documented 60000ms default.\n if (attr === null || attr.trim() === \"\") return 60000;\n const n = Number(attr);\n return Number.isFinite(n) ? n : 60000;\n }\n\n set threshold(value: number) {\n this.setAttribute(\"threshold\", String(value));\n }\n\n // --- Core delegated getters ---\n\n get userState(): IdleUserState | null {\n return this._core.userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._core.screenState;\n }\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands (delegated to Core) ---\n\n requestPermission(): Promise<\"granted\" | \"denied\"> {\n return this._core.requestPermission();\n }\n\n start(threshold?: number): Promise<void> {\n return this._core.start(threshold ?? this.threshold);\n }\n\n stop(): void {\n this._core.stop();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n // No auto-start (§6) — observe() is a synchronous no-op, kept only for\n // API uniformity with other IO nodes' lifecycle.\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { WcsIdle } from \"./components/Idle.js\";\nimport { config } from \"./config.js\";\n\nexport function registerComponents(): void {\n if (!customElements.get(config.tagNames.idle)) {\n customElements.define(config.tagNames.idle, WcsIdle);\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapIdle(userConfig?: IWritableConfig): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents();\n}\n"],"names":[],"mappings":"AAQA,MAAM,OAAO,GAAoB;AAC/B,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE,UAAU;AACjB,KAAA;CACF;AAED,SAAS,UAAU,CAAI,GAAM,EAAA;AAC3B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;AACvD,IAAA,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAClB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAClC,QAAA,UAAU,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC;IACnD;AACA,IAAA,OAAO,GAAG;AACZ;AAEA,SAAS,SAAS,CAAI,GAAM,EAAA;AAC1B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;IACvD,MAAM,KAAK,GAA4B,EAAE;IACzC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAClC,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC;IAC/D;AACA,IAAA,OAAO,KAAU;AACnB;AAEA,IAAI,YAAY,GAAmB,IAAI;AAEhC,MAAM,MAAM,GAAY,OAAkB;SAEjC,SAAS,GAAA;IACvB,IAAI,C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
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/config.ts","../src/core/idleCapabilities.ts","../src/core/IdleCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Idle.ts","../src/registerComponents.ts","../src/bootstrapIdle.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n idle: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n idle: \"wcs-idle\",\n },\n};\n\nfunction deepFreeze<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n Object.freeze(obj);\n for (const key of Object.keys(obj)) {\n deepFreeze((obj as Record<string, unknown>)[key]);\n }\n return obj;\n}\n\nfunction deepClone<T>(obj: T): T {\n if (obj === null || typeof obj !== \"object\") return obj;\n const clone: Record<string, unknown> = {};\n for (const key of Object.keys(obj)) {\n clone[key] = deepClone((obj as Record<string, unknown>)[key]);\n }\n return clone as T;\n}\n\nlet frozenConfig: IConfig | null = null;\n\nexport const config: IConfig = _config as IConfig;\n\nexport function getConfig(): IConfig {\n if (!frozenConfig) {\n frozenConfig = deepFreeze(deepClone(_config));\n }\n return frozenConfig;\n}\n\nexport function setConfig(partialConfig: IWritableConfig): void {\n if (partialConfig.tagNames) {\n Object.assign(_config.tagNames, partialConfig.tagNames);\n }\n frozenConfig = null;\n}\n","/**\n * idleCapabilities.ts\n *\n * Idle Detection node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。idle は requestPermission()/start()/stop() の単一コマンド経路で、競合する\n * operation を持たない(2 回目の start() は前を stop() してから開始する supersede)ため\n * lane は持たず、error taxonomy(errorInfo)のみを採用する。\n *\n * この node の `_setError` は 2 形態の入力を受ける:\n * 1. synthetic な非対応マーカー(`{ message: \"IdleDetector is not supported…\" }`、\n * `.name` 無し)— `globalThis.IdleDetector` 不在。\n * 2. caught された rejection を包んだ `{ error: e }`(`e.name` が実 Error.name)。\n * 両者を message coupling 無しに弁別するため、呼び出し側が明示的な `name` ヒントを渡す\n * (storage の `deriveStorageErrorInfo(error, name)` / screen-orientation と同じ\n * discriminator 技法)。非対応経路は `\"unsupported\"` を、caught 経路は wrap した\n * `e?.name` を渡す。\n *\n * requestPermission()/start() の実 rejection 名は spec のとおり gesture 文脈外 /\n * 権限未許可で `NotAllowedError`。それ以外(生の Error / TypeError(threshold 不正)/\n * `.name` 欠如の nullish reject 等)は一括して `idle-error`。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した idle error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_IDLE_ERROR_CODE = {\n /** Idle Detection API 非対応(`globalThis.IdleDetector` 不在)。 */\n CapabilityMissing: \"capability-missing\",\n /** `NotAllowedError` — 権限拒否 / user-gesture 文脈外。retry では回復しない。 */\n NotAllowed: \"not-allowed\",\n /** その他の requestPermission()/start() 失敗(生 throw / TypeError / nullish reject 等)。 */\n IdleError: \"idle-error\",\n} as const;\n\n/**\n * idle の失敗を serializable な error taxonomy に写す。\n *\n * `name` は呼び出し側が渡す discriminator:synthetic 非対応なら `\"unsupported\"`、\n * caught 例外なら wrap した `e?.name`(生の非 Error / nullish reject では `undefined`)。\n * `message` は wrap を解いた下位値から抽出済みの文言(非対応なら synthetic の message)。\n *\n * - `\"unsupported\"` は利用直前の能力欠如 → phase=\"probe\" / capability-missing。\n * - `NotAllowedError` は requestPermission()/start() の権限ゲート失敗 → phase=\"start\" /\n * not-allowed / recoverable=false(gesture 違反と実 \"denied\" は区別しない設計 §4.1)。\n * - それ以外(生の throw、TypeError、`.name` 欠如等)は実行中の失敗 → phase=\"execute\" /\n * idle-error / recoverable=false。\n */\nexport function deriveIdleErrorInfo(name: string | undefined, message: string): WcsIoErrorInfo {\n if (name === \"unsupported\") {\n return { code: WCS_IDLE_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (name === \"NotAllowedError\") {\n return { code: WCS_IDLE_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_IDLE_ERROR_CODE.IdleError, phase: \"execute\", recoverable: false, message };\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveIdleErrorInfo } from \"./idleCapabilities.js\";\n\ninterface IdleDetectorLike extends EventTarget {\n userState: IdleUserState;\n screenState: IdleScreenState;\n start(options: { threshold: number; signal: AbortSignal }): Promise<void>;\n}\n\ninterface IdleDetectorCtor {\n new (): IdleDetectorLike;\n requestPermission(): Promise<\"granted\" | \"denied\">;\n}\n\nconst MIN_THRESHOLD = 60000;\n\n/**\n * Headless Idle Detection primitive. A thin, framework-agnostic wrapper around\n * `IdleDetector` exposed through the wc-bindable protocol.\n *\n * Reference implementation for batch2's \"gesture-gated permission\" archetype\n * (docs/idle-detection-tag-design.md). `requestPermission()` wraps the static,\n * user-gesture-gated `IdleDetector.requestPermission()` — this Core never\n * calls it automatically; the caller must invoke it from within a real\n * gesture handler.\n *\n * Deliberately does NOT track the 4-value permission state (prompt/granted/\n * denied/unsupported) itself: `navigator.permissions.query({name:\n * \"idle-detection\"})` exists, so compose with `<wcs-permission\n * name=\"idle-detection\">` for that instead (§0). This Core only exposes the\n * actual idle state (userState/screenState) plus the one-time\n * requestPermission()/start()/stop() actions.\n */\nexport class IdleCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"userState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.userState },\n { name: \"screenState\", event: \"wcs-idle:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.screenState },\n {\n name: \"active\",\n event: \"wcs-idle:change\",\n semantics: \"state\",\n getter: (e: Event) => (e as CustomEvent).detail.userState === \"active\",\n },\n // never-throw (§3.6): requestPermission()/start() failures land here\n // instead of rejecting/throwing. Mirrors every other bidirectional IO\n // node in this batch (fetch, share, screen-orientation).\n { name: \"error\", event: \"wcs-idle:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error` (capability-missing / not-allowed\n // / idle-error); the existing `error` property/event are unchanged. Fires\n // wcs-idle:error-info-changed. No lane — requestPermission()/start()/stop() form a\n // single command path (a 2nd start() supersedes the 1st), not competing operations.\n { name: \"errorInfo\", event: \"wcs-idle:error-info-changed\", semantics: \"state\" },\n ],\n // No `inputs`: the Core has no settable `threshold` state — `threshold` is a\n // per-call argument to `start(threshold)`, not a property/setter. The DOM-driven\n // `threshold` input surface belongs to the Shell (which declares it and backs it\n // with the `threshold` attribute), mirroring geolocation/intersection where the\n // Core declares no inputs and the Shell adds them.\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\", async: true },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _userState: IdleUserState | null = null;\n private _screenState: IdleScreenState | null = null;\n private _error: any = null;\n // Additive failure taxonomy, kept strictly in sync with `_error` (derived on\n // every _setError, cleared to null when error clears). The two transition together.\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _detector: IdleDetectorLike | null = null;\n private _abortController: AbortController | null = null;\n\n // Generation guard (§3.4): bumped on dispose()/stop() and each start().\n private _gen = 0;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate (docs/idle-detection-tag-design.md §7).\n private _ready: Promise<void> = Promise.resolve();\n\n constructor(target?: EventTarget) {\n super();\n this._target = target ?? this;\n }\n\n get ready(): Promise<void> {\n return this._ready;\n }\n\n get userState(): IdleUserState | null {\n return this._userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._screenState;\n }\n\n get active(): boolean {\n return this._userState === \"active\";\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-idle:error-info-changed`), derived from `error`; the existing `error`\n * property/event are unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n // Lifecycle (§3.5). observe() is a synchronous no-op: unlike most IO nodes,\n // this Core deliberately does NOT auto-start on connect (§6) — permission\n // is gesture-gated, so attempting start() before it is granted is\n // guaranteed to fail.\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _api(): IdleDetectorCtor | undefined {\n const g = globalThis as any;\n return typeof g.IdleDetector === \"function\" ? g.IdleDetector : undefined;\n }\n\n private _setState(userState: IdleUserState, screenState: IdleScreenState): void {\n if (this._userState === userState && this._screenState === screenState) return;\n this._userState = userState;\n this._screenState = screenState;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:change\", {\n detail: { userState, screenState },\n bubbles: true,\n }));\n }\n\n // `name` is the discriminator for the additive `errorInfo` taxonomy only (it\n // stays out of the public `error` shape): the synthetic unsupported marker has\n // no `.name`, so the unsupported call sites pass an explicit `\"unsupported\"`\n // hint (storage/screen-orientation-style — avoids coupling to `error.message`),\n // while the caught paths pass the wrapped rejection's `Error.name` (`e?.name`).\n // `null` clears (no name).\n private _setError(error: any, name?: string): void {\n if (this._error === error) return;\n this._error = error;\n // Keep the additive `errorInfo` taxonomy in sync with `error`: derive from the\n // discriminator + extracted message (or null on clear). Fires before the `error`\n // event so an observer binding both sees the classification first, mirroring the\n // io-node family.\n this._commitErrorInfo(error === null ? null : deriveIdleErrorInfo(name, this._errorInfoMessage(error)));\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Extract a serializable string message for `errorInfo` WITHOUT normalizing the\n // public `error` shape. The public error is either the synthetic `{ message }`\n // (unsupported) or a wrapped `{ error: e }` (a caught rejection). For the wrapped\n // form the meaningful message lives on `e`, so unwrap one level before reading\n // `.message`; a non-conformant / nullish value (e.g. `Promise.reject(undefined)`)\n // falls back to `String(...)` so it still classifies instead of throwing\n // (never-throw §3.6).\n private _errorInfoMessage(error: any): string {\n const src = error != null && typeof error === \"object\" && \"error\" in error ? error.error : error;\n return typeof src?.message === \"string\" ? src.message : String(src);\n }\n\n // Called only from _setError (which already same-value-guards on the error\n // reference), so errorInfo transitions exactly when error does — no separate\n // guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-idle:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps the static, user-gesture-gated `IdleDetector.requestPermission()`.\n * MUST be invoked from within a real user gesture handler by the caller —\n * this Core cannot manufacture one. never-throw: a gesture-context\n * rejection resolves to `\"denied\"` and lands in `error`. Gesture violation\n * and an actual \"denied\" outcome are not distinguished — both mean \"not\n * usable right now\" (§4.1).\n */\n async requestPermission(): Promise<\"granted\" | \"denied\"> {\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return \"denied\";\n }\n try {\n const result = await Ctor.requestPermission();\n // Symmetric with start()'s success path: any settled (non-throwing)\n // outcome — granted or a plain \"denied\" — supersedes a stale error from\n // an earlier attempt (e.g. a prior gesture-context rejection).\n this._setError(null);\n return result === \"granted\" ? \"granted\" : \"denied\";\n } catch (e: any) {\n this._setError({ error: e }, e?.name);\n return \"denied\";\n }\n }\n\n /**\n * Start an idle-detection session. `threshold` (ms) must be >= 60000 per\n * spec — not validated here (§3): an out-of-range value is left to the\n * browser's own TypeError, which never-throw absorbs into `error`.\n */\n async start(threshold: number = MIN_THRESHOLD): Promise<void> {\n this.stop(); // supersede any in-flight session (mirrors FetchCore's \"cancel then start\")\n\n const Ctor = this._api();\n if (!Ctor) {\n this._setError({ message: \"IdleDetector is not supported in this browser\" }, \"unsupported\");\n return;\n }\n\n const ac = new AbortController();\n this._abortController = ac;\n const gen = ++this._gen;\n\n try {\n const detector = new Ctor();\n detector.addEventListener(\"change\", this._onChange);\n this._detector = detector;\n await detector.start({ threshold, signal: ac.signal });\n if (gen !== this._gen) return; // stale (stop()/dispose() ran during the await)\n this._setError(null);\n this._setState(detector.userState, detector.screenState);\n } catch (e: any) {\n // No separate AbortError check: stop()/dispose() bump `_gen` *before*\n // calling `ac.abort()` (see stop() below), so a stop()-triggered\n // AbortError always has a stale `gen` here and is already caught by\n // the check above. The signal is private and never exposed, so an\n // AbortError from any other source cannot occur.\n if (gen !== this._gen) return;\n // Tear down the failed session's listener/controller (mirrors stop()):\n // without this, the failed `_detector` stays wired to `_onChange` and a\n // later `change` on that same (never-truly-started) instance would\n // still write state, contradicting the error just recorded.\n this._detector?.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n this._abortController = null;\n this._setError({ error: e }, e?.name);\n }\n }\n\n /** Stop the current session (if any) and detach its listener. Safe to call when not started. */\n stop(): void {\n this._gen++;\n this._abortController?.abort();\n this._abortController = null;\n if (this._detector) {\n this._detector.removeEventListener(\"change\", this._onChange);\n this._detector = null;\n }\n }\n\n private _onChange = (event: Event): void => {\n const detector = event.target as IdleDetectorLike;\n this._setState(detector.userState, detector.screenState);\n };\n}\n","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/upgrade-properties.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// custom element の property upgrade — `static wcBindable.inputs` に宣言した入力のうち、\n// 要素が upgrade される前に代入された own データプロパティを取り込み直す。\n//\n// なぜ必要か:\n// 未定義タグの要素は素の HTMLElement なので、`el.url = \"...\"` は own データプロパティを作る。\n// upgrade 後にクラスの accessor が prototype へ入っても own プロパティが優先されるため、\n// setter は二度と呼ばれず、値は要素へ届かないまま消える(エラーも警告も出ない)。\n// 常にプロパティ代入を行う framework(Angular の `[prop]`、Lit の `.prop=`、\n// Solid の `prop:`、Vue の `.prop` 修飾子)× 遅延定義(autoloader / CDN / code-split)で\n// 常態的に起きる。docs/architecture-hardening/13-framework-adapter-binding-constraints.md §1.2。\n//\n// 安全側の判定:\n// own プロパティがあっても、prototype チェーンに accessor が無ければ「シャドウ」ではなく\n// その own プロパティ自体が正規の格納先なので触らない(public class field を壊さない)。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/upgrade-properties.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/upgradeProperties.ts). Those copies are generated — do not edit them.\nimport { IWcBindable } from \"./wcBindable.js\";\n\nfunction hasAccessorOnPrototype(target: object, name: string): boolean {\n let proto = Object.getPrototypeOf(target);\n while (proto !== null) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor !== undefined) {\n return typeof descriptor.get === \"function\" || typeof descriptor.set === \"function\";\n }\n proto = Object.getPrototypeOf(proto);\n }\n return false;\n}\n\n/**\n * `connectedCallback` の先頭で呼ぶ。宣言済み input のうち upgrade 前の代入で\n * accessor をシャドウしている own プロパティを、delete → 再代入で setter に通し直す。\n *\n * - 冪等: 再代入は accessor を通るので own プロパティは残らず、2 回目以降は no-op。\n * - 宣言に `inputs` が無い要素、`wcBindable` を持たない要素では何もしない。\n * - 値の意味は変えない。今まで捨てられていた代入が届くようになる一方向の変化。\n */\nexport function upgradeProperties(element: object): void {\n const declaration = (element as { constructor?: { wcBindable?: IWcBindable } }).constructor?.wcBindable;\n const inputs = declaration?.inputs;\n if (inputs === undefined) return;\n for (const input of inputs) {\n const name = input.name;\n if (!Object.prototype.hasOwnProperty.call(element, name)) continue;\n if (!hasAccessorOnPrototype(element, name)) continue;\n const record = element as Record<string, unknown>;\n const value = record[name];\n delete record[name];\n record[name] = value;\n }\n}\n","import { IdleScreenState, IdleUserState, IWcBindable } from \"../types.js\";\nimport { IdleCore } from \"../core/IdleCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-idle>` — declarative Idle Detection API primitive.\n *\n * Does NOT auto-start on connect (docs/idle-detection-tag-design.md §6): the\n * permission gate sits in front of `start()`, so an unconditional\n * connectedCallback start would be guaranteed to fail before permission is\n * granted. Callers drive `requestPermission()` → `start()` explicitly, e.g.\n * from a click handler.\n *\n * Compose with `<wcs-permission name=\"idle-detection\">` for prompt/granted/\n * denied status — this Shell only exposes the actual idle state.\n */\nexport class WcsIdle extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...IdleCore.wcBindable,\n inputs: [\n { name: \"threshold\", attribute: \"threshold\" },\n ],\n // Core の commands をそのまま継承(単一情報源)。\n commands: IdleCore.wcBindable.commands,\n };\n\n private _core: IdleCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new IdleCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-idle:change\": (d) => ({ active: d.userState === \"active\" }),\n \"wcs-idle:error\": (d) => ({ error: d != null }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1/§3.4): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n // --- Attribute accessors ---\n\n /**\n * Minimum idle time (ms) before `userState` becomes `\"idle\"`. This value is\n * read only at `start()` time — there is no `attributeChangedCallback`\n * (deliberately not declared in `observedAttributes`, mirroring\n * `<wcs-gyroscope>`'s `frequency`), so mutating the attribute/property on an\n * already-running session has no effect until the caller `stop()`s and\n * `start()`s again.\n */\n get threshold(): number {\n const attr = this.getAttribute(\"threshold\");\n // An absent, empty, or whitespace-only attribute all mean \"no value\n // supplied\" and must fall back to the default — without this check,\n // `Number(\"\")`/`Number(\" \")` coerce to `0` (finite), which would slip\n // past the `Number.isFinite` fallback below and silently return `0`\n // instead of the documented 60000ms default.\n if (attr === null || attr.trim() === \"\") return 60000;\n const n = Number(attr);\n return Number.isFinite(n) ? n : 60000;\n }\n\n set threshold(value: number) {\n this.setAttribute(\"threshold\", String(value));\n }\n\n // --- Core delegated getters ---\n\n get userState(): IdleUserState | null {\n return this._core.userState;\n }\n\n get screenState(): IdleScreenState | null {\n return this._core.screenState;\n }\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Commands (delegated to Core) ---\n\n requestPermission(): Promise<\"granted\" | \"denied\"> {\n return this._core.requestPermission();\n }\n\n start(threshold?: number): Promise<void> {\n return this._core.start(threshold ?? this.threshold);\n }\n\n stop(): void {\n this._core.stop();\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this.style.display = \"none\";\n // No auto-start (§6) — observe() is a synchronous no-op, kept only for\n // API uniformity with other IO nodes' lifecycle.\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { WcsIdle } from \"./components/Idle.js\";\nimport { config } from \"./config.js\";\n\n/**\n * Register this package's tags. Pass a scoped `CustomElementRegistry` to define\n * them for a single shadow tree -- scoped registries do not inherit the global\n * one, so a tree using one needs its own definitions.\n */\nexport function registerComponents(registry: CustomElementRegistry = customElements): void {\n if (!registry.get(config.tagNames.idle)) {\n registry.define(config.tagNames.idle, WcsIdle);\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapIdle(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n"],"names":[],"mappings":"AAQA,MAAM,OAAO,GAAoB;AAC/B,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE,UAAU;AACjB,KAAA;CACF;AAED,SAAS,UAAU,CAAI,GAAM,EAAA;AAC3B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;AACvD,IAAA,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAClB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAClC,QAAA,UAAU,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC;IACnD;AACA,IAAA,OAAO,GAAG;AACZ;AAEA,SAAS,SAAS,CAAI,GAAM,EAAA;AAC1B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;IACvD,MAAM,KAAK,GAA4B,EAAE;IACzC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC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CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACvC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAChD;AACF;;ACRM,SAAU,aAAa,CAAC,UAA4B,EAAE,QAAgC,EAAA;IAC1F,IAAI,UAAU,EAAE;QACd,SAAS,CAAC,UAAU,CAAC;IACvB;IACA,kBAAkB,CAAC,QAAQ,CAAC;AAC9B;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wcstack/idle",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "Declarative Idle Detection component for Web Components. Framework-agnostic IdleDetector wrapper via wc-bindable-protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.esm.js",
|