@wcstack/tilt 1.29.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 CHANGED
@@ -1,2 +1,2 @@
1
- const t={tagNames:{tilt:"wcs-tilt"}},e="not-allowed",s="tilt-error";const r=Object.freeze({alpha:null,beta:null,gamma:null,absolute:null});class n extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"alpha",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.alpha},{name:"beta",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.beta},{name:"gamma",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.gamma},{name:"absolute",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.absolute},{name:"permissionState",event:"wcs-tilt:permission-changed",semantics:"state"},{name:"error",event:"wcs-tilt:error",semantics:"state"},{name:"errorInfo",event:"wcs-tilt:error-info-changed",semantics:"state"}],commands:[{name:"requestPermission",async:!0},{name:"start"},{name:"stop"}]};_target;_snapshot=r;_permissionState="unknown";_error=null;_errorInfo=null;_subscribed=!1;_ready=Promise.resolve();constructor(t){super(),this._target=t??this}get ready(){return this._ready}get alpha(){return this._snapshot.alpha}get beta(){return this._snapshot.beta}get gamma(){return this._snapshot.gamma}get absolute(){return this._snapshot.absolute}get permissionState(){return this._permissionState}get error(){return this._error}get errorInfo(){return this._errorInfo}observe(){return this._ready}dispose(){this.stop()}_deviceOrientationEventCtor(){const t=globalThis;return void 0!==t.DeviceOrientationEvent?t.DeviceOrientationEvent:void 0}_setPermissionState(t){this._permissionState!==t&&(this._permissionState=t,this._target.dispatchEvent(new CustomEvent("wcs-tilt:permission-changed",{detail:t,bubbles:!0})))}_setError(t){this._error!==t&&(this._error=t,this._commitErrorInfo(null===t?null:function(t){const r=t.error?.name,n=t.error?.message??String(t.error);return"NotAllowedError"===r?{code:e,phase:"start",recoverable:!1,message:n}:{code:s,phase:"execute",recoverable:!1,message:n}}(t)),this._target.dispatchEvent(new CustomEvent("wcs-tilt:error",{detail:t,bubbles:!0})))}_commitErrorInfo(t){this._errorInfo=t,this._target.dispatchEvent(new CustomEvent("wcs-tilt:error-info-changed",{detail:t,bubbles:!0}))}async requestPermission(){const t=this._deviceOrientationEventCtor();if("function"!=typeof t?.requestPermission)return this._setError(null),this._setPermissionState("granted"),"granted";try{const e="granted"===await t.requestPermission()?"granted":"denied";return this._setError(null),this._setPermissionState(e),e}catch(t){return this._setError({error:t}),this._setPermissionState("denied"),"denied"}}start(){this._subscribed||(this._subscribed=!0,globalThis.window?.addEventListener("deviceorientation",this._onOrientation))}stop(){this._subscribed&&(this._subscribed=!1,globalThis.window?.removeEventListener("deviceorientation",this._onOrientation))}_onOrientation=t=>{this._apply({alpha:t.alpha,beta:t.beta,gamma:t.gamma,absolute:t.absolute})};_apply(t){const e=this._snapshot;e.alpha===t.alpha&&e.beta===t.beta&&e.gamma===t.gamma&&e.absolute===t.absolute||(this._snapshot=t,this._target.dispatchEvent(new CustomEvent("wcs-tilt:change",{detail:t,bubbles:!0})))}}function i(t,e){let s=Object.getPrototypeOf(t);for(;null!==s;){const t=Object.getOwnPropertyDescriptor(s,e);if(void 0!==t)return"function"==typeof t.get||"function"==typeof t.set;s=Object.getPrototypeOf(s)}return!1}class a extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...n.wcBindable,inputs:[],commands:n.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new n(this),this._internals=this._initInternals(),this._wireStates({"wcs-tilt:error":t=>({error:null!=t})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const t=this.attachInternals();return t.states.add("wcs-probe"),t.states.delete("wcs-probe"),t}catch{return null}}_wireStates(t){if(null===this._internals)return;const e=this._internals.states;for(const[s,r]of Object.entries(t))this.addEventListener(s,t=>{const s=this.hasAttribute("debug-states");for(const[n,i]of Object.entries(r(t.detail))){try{i?e.add(n):e.delete(n)}catch{}s&&this.toggleAttribute(`data-wcs-state-${n}`,i)}})}get alpha(){return this._core.alpha}get beta(){return this._core.beta}get gamma(){return this._core.gamma}get absolute(){return this._core.absolute}get permissionState(){return this._core.permissionState}get error(){return this._core.error}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}requestPermission(){return this._core.requestPermission()}start(){this._core.start()}stop(){this._core.stop()}connectedCallback(){!function(t){const e=t.constructor?.wcBindable,s=e?.inputs;if(void 0!==s)for(const e of s){const s=e.name;if(!Object.prototype.hasOwnProperty.call(t,s))continue;if(!i(t,s))continue;const r=t,n=r[s];delete r[s],r[s]=n}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}customElements.get(t.tagNames.tilt)||customElements.define(t.tagNames.tilt,a);
1
+ const t={tagNames:{tilt:"wcs-tilt"}},e="not-allowed",s="tilt-error";const r=Object.freeze({alpha:null,beta:null,gamma:null,absolute:null});class n extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"alpha",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.alpha},{name:"beta",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.beta},{name:"gamma",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.gamma},{name:"absolute",event:"wcs-tilt:change",semantics:"state",getter:t=>t.detail.absolute},{name:"permissionState",event:"wcs-tilt:permission-changed",semantics:"state"},{name:"error",event:"wcs-tilt:error",semantics:"state"},{name:"errorInfo",event:"wcs-tilt:error-info-changed",semantics:"state"}],commands:[{name:"requestPermission",async:!0},{name:"start"},{name:"stop"}]};_target;_snapshot=r;_permissionState="unknown";_error=null;_errorInfo=null;_subscribed=!1;_ready=Promise.resolve();constructor(t){super(),this._target=t??this}get ready(){return this._ready}get alpha(){return this._snapshot.alpha}get beta(){return this._snapshot.beta}get gamma(){return this._snapshot.gamma}get absolute(){return this._snapshot.absolute}get permissionState(){return this._permissionState}get error(){return this._error}get errorInfo(){return this._errorInfo}observe(){return this._ready}dispose(){this.stop()}_deviceOrientationEventCtor(){const t=globalThis;return void 0!==t.DeviceOrientationEvent?t.DeviceOrientationEvent:void 0}_setPermissionState(t){this._permissionState!==t&&(this._permissionState=t,this._target.dispatchEvent(new CustomEvent("wcs-tilt:permission-changed",{detail:t,bubbles:!0})))}_setError(t){this._error!==t&&(this._error=t,this._commitErrorInfo(null===t?null:function(t){const r=t.error?.name,n=t.error?.message??String(t.error);return"NotAllowedError"===r?{code:e,phase:"start",recoverable:!1,message:n}:{code:s,phase:"execute",recoverable:!1,message:n}}(t)),this._target.dispatchEvent(new CustomEvent("wcs-tilt:error",{detail:t,bubbles:!0})))}_commitErrorInfo(t){this._errorInfo=t,this._target.dispatchEvent(new CustomEvent("wcs-tilt:error-info-changed",{detail:t,bubbles:!0}))}async requestPermission(){const t=this._deviceOrientationEventCtor();if("function"!=typeof t?.requestPermission)return this._setError(null),this._setPermissionState("granted"),"granted";try{const e="granted"===await t.requestPermission()?"granted":"denied";return this._setError(null),this._setPermissionState(e),e}catch(t){return this._setError({error:t}),this._setPermissionState("denied"),"denied"}}start(){this._subscribed||(this._subscribed=!0,globalThis.window?.addEventListener("deviceorientation",this._onOrientation))}stop(){this._subscribed&&(this._subscribed=!1,globalThis.window?.removeEventListener("deviceorientation",this._onOrientation))}_onOrientation=t=>{this._apply({alpha:t.alpha,beta:t.beta,gamma:t.gamma,absolute:t.absolute})};_apply(t){const e=this._snapshot;e.alpha===t.alpha&&e.beta===t.beta&&e.gamma===t.gamma&&e.absolute===t.absolute||(this._snapshot=t,this._target.dispatchEvent(new CustomEvent("wcs-tilt:change",{detail:t,bubbles:!0})))}}function i(t,e){let s=Object.getPrototypeOf(t);for(;null!==s;){const t=Object.getOwnPropertyDescriptor(s,e);if(void 0!==t)return"function"==typeof t.get||"function"==typeof t.set;s=Object.getPrototypeOf(s)}return!1}class a extends HTMLElement{static hasConnectedCallbackPromise=!0;static wcBindable={...n.wcBindable,inputs:[],commands:n.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new n(this),this._internals=this._initInternals(),this._wireStates({"wcs-tilt:error":t=>({error:null!=t})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const t=this.attachInternals();return t.states.add("wcs-probe"),t.states.delete("wcs-probe"),t}catch{return null}}_wireStates(t){if(null===this._internals)return;const e=this._internals.states;for(const[s,r]of Object.entries(t))this.addEventListener(s,t=>{const s=this.hasAttribute("debug-states");for(const[n,i]of Object.entries(r(t.detail))){try{i?e.add(n):e.delete(n)}catch{}s&&this.toggleAttribute(`data-wcs-state-${n}`,i)}})}get alpha(){return this._core.alpha}get beta(){return this._core.beta}get gamma(){return this._core.gamma}get absolute(){return this._core.absolute}get permissionState(){return this._core.permissionState}get error(){return this._core.error}get errorInfo(){return this._core.errorInfo}get connectedCallbackPromise(){return this._connectedCallbackPromise}requestPermission(){return this._core.requestPermission()}start(){this._core.start()}stop(){this._core.stop()}connectedCallback(){!function(t){const e=t.constructor?.wcBindable,s=e?.inputs;if(void 0!==s)for(const e of s){const s=e.name;if(!Object.prototype.hasOwnProperty.call(t,s))continue;if(!i(t,s))continue;const r=t,n=r[s];delete r[s],r[s]=n}}(this),this.style.display="none",this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}}var o;!function(e=customElements){e.get(t.tagNames.tilt)||e.define(t.tagNames.tilt,a)}(o);
2
2
  //# sourceMappingURL=auto.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto.min.js","sources":["../src/config.ts","../src/core/tiltCapabilities.ts","../src/core/TiltCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Tilt.ts","../src/registerComponents.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n tilt: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n tilt: \"wcs-tilt\",\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 * tiltCapabilities.ts\n *\n * Tilt(Device Orientation)node 固有の error code(taxonomy)と derivation。汎用の\n * error info 型は `./platformCapability.js`(/io-core/ から copy-distribution される\n * 生成ファイル)から import する。tilt は監視系(deviceorientation の subscribe/\n * unsubscribe)で競合する operation を持たないため lane は持たず、error taxonomy\n * (errorInfo)のみを採用する。\n *\n * sensor 4 兄弟(accelerometer / gyroscope / magnetometer / ambient-light-sensor)と\n * 違い、tilt の error 面は **異なる shape** を持つ:\n * - sensor 族の error detail は `{ error: <Error.name>, message }`(name/message は文字列)。\n * - tilt の error detail は `{ error: <生の rejection reason> }`(TiltCore._setError が\n * `requestPermission()` の catch で `{ error: e }` を渡す。`e` は生の Error/reason)。\n *\n * したがって derive は「wrap された生の値」から name/message を取り出す。また tilt は\n * \"unsupported\"(capability-missing)経路を **持たない**: `DeviceOrientationEvent` や\n * その `requestPermission` が無い環境では error にせず `\"granted\"` に倒して error を\n * クリアする(docs/device-orientation-tag-design.md §3)。よって capability-missing の\n * code / branch は生成しない(到達不能・dead code を避ける)。error として _setError に\n * 届くのは iOS の `requestPermission()` reject だけで、その name は実権限拒否なら\n * `NotAllowedError`、gesture 文脈外等なら汎用 `Error` になる。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した tilt error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_TILT_ERROR_CODE = {\n /** `NotAllowedError` — iOS の Device Orientation 権限拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の `requestPermission()` reject(gesture 文脈外 / 想定外の失敗)。 */\n TiltError: \"tilt-error\",\n} as const;\n\n/**\n * tilt の失敗(`_setError` に渡る `{ error: <生の reason> }`)を serializable な error\n * taxonomy に写す。name は wrap された reason の `Error.name`、message はその `.message`\n * (無ければ `String(...)`)。\n *\n * - `NotAllowedError` は iOS の権限拒否 → phase=\"start\" / not-allowed。retry で回復しない。\n * - それ以外(gesture 文脈外の汎用 `Error`、非 Error reason 等)→ phase=\"execute\" /\n * tilt-error。\n *\n * capability-missing 経路は無い(上のヘッダ参照): 非対応環境は error ではなく\n * `\"granted\"` へ倒れるため、ここには到達しない。\n */\nexport function deriveTiltErrorInfo(detail: { error?: any }): WcsIoErrorInfo {\n const name: string | undefined = detail.error?.name;\n const message: string = detail.error?.message ?? String(detail.error);\n if (name === \"NotAllowedError\") {\n return { code: WCS_TILT_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_TILT_ERROR_CODE.TiltError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveTiltErrorInfo } from \"./tiltCapabilities.js\";\n\ninterface DeviceOrientationEventCtor {\n requestPermission?: () => Promise<\"granted\" | \"denied\">;\n}\n\ninterface WcsTiltSnapshot {\n alpha: number | null;\n beta: number | null;\n gamma: number | null;\n absolute: boolean | null;\n}\n\nconst UNSUPPORTED_SNAPSHOT: WcsTiltSnapshot = Object.freeze({\n alpha: null,\n beta: null,\n gamma: null,\n absolute: null,\n});\n\n/**\n * Headless Device Orientation primitive. A thin, framework-agnostic wrapper\n * around `window`'s `deviceorientation` event exposed through the wc-bindable\n * protocol.\n *\n * The batch2 sibling of `@wcstack/idle` (docs/device-orientation-tag-design.md).\n * Unlike Idle Detection, there is no matching Permissions API entry for this\n * feature (`navigator.permissions.query` has no \"device-orientation\" name), so\n * `permissionState` must be tracked **locally** rather than composed with\n * `<wcs-permission>` — the defining asymmetry within batch2.\n *\n * No `_gen` generation guard: subscribing/unsubscribing to `deviceorientation`\n * (start/stop) is fully synchronous, so that path never needs one. This node\n * does have an async probe — `requestPermission()` awaits the static\n * `DeviceOrientationEvent.requestPermission()` — but its post-await write is\n * a benign `permissionState`/`error` value set + dispatch with no\n * subscription/resource management to race, so `_gen` is unneeded there too\n * (docs/device-orientation-tag-design.md §4, corrected after an earlier\n * revision mistakenly reused `@wcstack/network`'s \"no async probe at all\"\n * rationale).\n */\nexport class TiltCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"alpha\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.alpha },\n { name: \"beta\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.beta },\n { name: \"gamma\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.gamma },\n { name: \"absolute\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.absolute },\n { name: \"permissionState\", event: \"wcs-tilt:permission-changed\", semantics: \"state\" },\n // never-throw (§3.6): requestPermission() failures land here instead of\n // rejecting/throwing. Mirrors idle (same batch2) and the accelerometer\n // family (batch5) — see docs/io-node-batch-implementation-plan.md.\n { name: \"error\", event: \"wcs-tilt:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error.error` (the wrapped rejection's\n // Error.name); the existing `error` property/event are unchanged. Fires\n // wcs-tilt:error-info-changed. No lane — this is a monitor node.\n { name: \"errorInfo\", event: \"wcs-tilt:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\" },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _snapshot: WcsTiltSnapshot = UNSUPPORTED_SNAPSHOT;\n private _permissionState: TiltPermissionState = \"unknown\";\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _subscribed = false;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate.\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 alpha(): number | null {\n return this._snapshot.alpha;\n }\n\n get beta(): number | null {\n return this._snapshot.beta;\n }\n\n get gamma(): number | null {\n return this._snapshot.gamma;\n }\n\n get absolute(): boolean | null {\n return this._snapshot.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._permissionState;\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-tilt: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: like `<wcs-idle>`,\n // this Core deliberately does NOT auto-start on connect (§6) on platforms\n // that gate deviceorientation behind requestPermission().\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _deviceOrientationEventCtor(): DeviceOrientationEventCtor | undefined {\n const g = globalThis as any;\n return typeof g.DeviceOrientationEvent !== \"undefined\" ? g.DeviceOrientationEvent : undefined;\n }\n\n private _setPermissionState(state: TiltPermissionState): void {\n if (this._permissionState === state) return;\n this._permissionState = state;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:permission-changed\", {\n detail: state,\n bubbles: true,\n }));\n }\n\n private _setError(error: any): 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 // wrapped rejection (or null on clear). Fires before the `error` event so an\n // observer binding both sees the classification first, mirroring the io-node\n // family.\n this._commitErrorInfo(error === null ? null : deriveTiltErrorInfo(error));\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (which already reference-guards on the error\n // object), 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-tilt:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps iOS 13+ Safari's static, gesture-gated\n * `DeviceOrientationEvent.requestPermission()`. On platforms without this\n * gate (Android Chrome, desktop) there is nothing to ask, so this resolves\n * to `\"granted\"` immediately without querying anything — callers can write\n * one `requestPermission()` → `start()` flow that works everywhere\n * (docs/device-orientation-tag-design.md §3).\n *\n * never-throw (§3.6): a gesture-context rejection resolves to `\"denied\"`\n * and the raw error lands in `error` instead of propagating. Mirrors\n * `<wcs-idle>`'s `requestPermission()` (docs/idle-detection-tag-design.md\n * §4.1) — any settled (non-throwing) outcome supersedes a stale `error`\n * from an earlier attempt.\n */\n async requestPermission(): Promise<TiltPermissionState> {\n const Ctor = this._deviceOrientationEventCtor();\n if (typeof Ctor?.requestPermission !== \"function\") {\n this._setError(null);\n this._setPermissionState(\"granted\");\n return \"granted\";\n }\n try {\n const result = await Ctor.requestPermission();\n const state: TiltPermissionState = result === \"granted\" ? \"granted\" : \"denied\";\n this._setError(null);\n this._setPermissionState(state);\n return state;\n } catch (e) {\n // never-throw: a gesture-context rejection resolves to \"denied\".\n this._setError({ error: e });\n this._setPermissionState(\"denied\");\n return \"denied\";\n }\n }\n\n /** Subscribe to `deviceorientation`. Idempotent — a second start() while already subscribed is a no-op. */\n start(): void {\n if (this._subscribed) return;\n this._subscribed = true;\n globalThis.window?.addEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n /** Unsubscribe from `deviceorientation`. Safe to call when not started. */\n stop(): void {\n if (!this._subscribed) return;\n this._subscribed = false;\n globalThis.window?.removeEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n private _onOrientation = (event: DeviceOrientationEvent): void => {\n this._apply({\n alpha: event.alpha,\n beta: event.beta,\n gamma: event.gamma,\n absolute: event.absolute,\n });\n };\n\n // Same-value guard (§3.3 MUST).\n private _apply(next: WcsTiltSnapshot): void {\n const prev = this._snapshot;\n if (\n prev.alpha === next.alpha &&\n prev.beta === next.beta &&\n prev.gamma === next.gamma &&\n prev.absolute === next.absolute\n ) {\n return;\n }\n this._snapshot = next;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:change\", {\n detail: next,\n bubbles: true,\n }));\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 { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { TiltCore } from \"../core/TiltCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-tilt>` — declarative Device Orientation API monitor.\n *\n * Named `tilt` (not `orientation`/`device-orientation`) to avoid colliding\n * with `<wcs-screen-orientation>` (docs/device-orientation-tag-design.md §9).\n *\n * Does NOT auto-start on connect, mirroring `<wcs-idle>`: on iOS, subscribing\n * before permission is granted silently receives no events. Callers drive\n * `requestPermission()` → `start()` explicitly.\n */\nexport class WcsTilt extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...TiltCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: TiltCore.wcBindable.commands,\n };\n\n private _core: TiltCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new TiltCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-tilt: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 (async-io-node-guidelines.md §3.6): attachInternals is absent\n // 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 // --- Core delegated getters ---\n\n get alpha(): number | null {\n return this._core.alpha;\n }\n\n get beta(): number | null {\n return this._core.beta;\n }\n\n get gamma(): number | null {\n return this._core.gamma;\n }\n\n get absolute(): boolean | null {\n return this._core.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._core.permissionState;\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<TiltPermissionState> {\n return this._core.requestPermission();\n }\n\n start(): void {\n this._core.start();\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 this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { WcsTilt } from \"./components/Tilt.js\";\nimport { config } from \"./config.js\";\n\nexport function registerComponents(): void {\n if (!customElements.get(config.tagNames.tilt)) {\n customElements.define(config.tagNames.tilt, WcsTilt);\n }\n}\n"],"names":["config","tagNames","tilt","WCS_TILT_ERROR_CODE","UNSUPPORTED_SNAPSHOT","Object","freeze","alpha","beta","gamma","absolute","TiltCore","EventTarget","static","protocol","version","properties","name","event","semantics","getter","e","detail","commands","async","_target","_snapshot","_permissionState","_error","_errorInfo","_subscribed","_ready","Promise","resolve","constructor","target","super","this","ready","permissionState","error","errorInfo","observe","dispose","stop","_deviceOrientationEventCtor","g","globalThis","DeviceOrientationEvent","undefined","_setPermissionState","state","dispatchEvent","CustomEvent","bubbles","_setError","_commitErrorInfo","message","String","code","phase","recoverable","deriveTiltErrorInfo","info","requestPermission","Ctor","start","window","addEventListener","_onOrientation","removeEventListener","_apply","next","prev","hasAccessorOnPrototype","proto","getPrototypeOf","descriptor","getOwnPropertyDescriptor","get","set","WcsTilt","HTMLElement","wcBindable","inputs","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","d","debugStates","states","attachInternals","internals","add","delete","map","toStates","entries","debug","hasAttribute","on","toggleAttribute","connectedCallbackPromise","connectedCallback","element","declaration","input","prototype","hasOwnProperty","call","record","value","upgradeProperties","style","display","disconnectedCallback","customElements","define"],"mappings":"AAQA,MA0BaA,EA1BoB,CAC/BC,SAAU,CACRC,KAAM,aCiBGC,EAEC,cAFDA,EAIA,aChBb,MAAMC,EAAwCC,OAAOC,OAAO,CAC1DC,MAAO,KACPC,KAAM,KACNC,MAAO,KACPC,SAAU,OAwBN,MAAOC,UAAiBC,YAC5BC,kBAAiC,CAC/BC,SAAU,cACVC,QAAS,EACTC,WAAY,CACV,CAAEC,KAAM,QAASC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOf,OAC/G,CAAEU,KAAM,OAAQC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOd,MAC9G,CAAES,KAAM,QAASC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOb,OAC/G,CAAEQ,KAAM,WAAYC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOZ,UAClH,CAAEO,KAAM,kBAAmBC,MAAO,8BAA+BC,UAAW,SAI5E,CAAEF,KAAM,QAASC,MAAO,iBAAkBC,UAAW,SAKrD,CAAEF,KAAM,YAAaC,MAAO,8BAA+BC,UAAW,UAExEI,SAAU,CACR,CAAEN,KAAM,oBAAqBO,OAAO,GACpC,CAAEP,KAAM,SACR,CAAEA,KAAM,UAIJQ,QACAC,UAA6BtB,EAC7BuB,iBAAwC,UACxCC,OAAc,KACdC,WAAoC,KACpCC,aAAc,EAIdC,OAAwBC,QAAQC,UAExC,WAAAC,CAAYC,GACVC,QACAC,KAAKZ,QAAUU,GAAUE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O6B,KAAKgD,MAAM7E,IACpB,CAEA,SAAIC,GACF,OAAO4B,KAAKgD,MAAM5E,KACpB,CAEA,YAAIC,GACF,OAAO2B,KAAKgD,MAAM3E,QACpB,CAEA,mBAAI6B,GACF,OAAOF,KAAKgD,MAAM9C,eACpB,CAEA,SAAIC,GACF,OAAOH,KAAKgD,MAAM7C,KACpB,CAEA,aAAIC,GACF,OAAOJ,KAAKgD,MAAM5C,SACpB,CAEA,4BAAI+D,GACF,OAAOnE,KAAKiD,yBACd,CAIA,iBAAAtB,GACE,OAAO3B,KAAKgD,MAAMrB,mBACpB,CAEA,KAAAE,GACE7B,KAAKgD,MAAMnB,OACb,CAEA,IAAAtB,GACEP,KAAKgD,MAAMzC,MACb,CAIA,iBAAA6D,IDnFI,SAA4BC,GAChC,MAAMC,EAAeD,EAA2DxE,aAAaiD,WACvFC,EAASuB,GAAavB,OAC5B,QAAenC,IAAXmC,EACJ,IAAK,MAAMwB,KAASxB,EAAQ,CAC1B,MAAMnE,EAAO2F,EAAM3F,KACnB,IAAKZ,OAAOwG,UAAUC,eAAeC,KAAKL,EAASzF,GAAO,SAC1D,IAAKyD,EAAuBgC,EAASzF,GAAO,SAC5C,MAAM+F,EAASN,EACTO,EAAQD,EAAO/F,UACd+F,EAAO/F,GACd+F,EAAO/F,GAAQgG,CACjB,CACF,CCwEIC,CAAkB7E,MAClBA,KAAK8E,MAAMC,QAAU,OACrB/E,KAAKiD,0BAA4BjD,KAAKgD,MAAM3C,SAC9C,CAEA,oBAAA2E,GACEhF,KAAKgD,MAAM1C,SACb,ECtIK2E,eAAevC,IAAI/E,EAAOC,SAASC,OACtCoH,eAAeC,OAAOvH,EAAOC,SAASC,KAAM+E"}
1
+ {"version":3,"file":"auto.min.js","sources":["../src/config.ts","../src/core/tiltCapabilities.ts","../src/core/TiltCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Tilt.ts","../src/bootstrapTilt.ts","../src/registerComponents.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n tilt: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n tilt: \"wcs-tilt\",\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 * tiltCapabilities.ts\n *\n * Tilt(Device Orientation)node 固有の error code(taxonomy)と derivation。汎用の\n * error info 型は `./platformCapability.js`(/io-core/ から copy-distribution される\n * 生成ファイル)から import する。tilt は監視系(deviceorientation の subscribe/\n * unsubscribe)で競合する operation を持たないため lane は持たず、error taxonomy\n * (errorInfo)のみを採用する。\n *\n * sensor 4 兄弟(accelerometer / gyroscope / magnetometer / ambient-light-sensor)と\n * 違い、tilt の error 面は **異なる shape** を持つ:\n * - sensor 族の error detail は `{ error: <Error.name>, message }`(name/message は文字列)。\n * - tilt の error detail は `{ error: <生の rejection reason> }`(TiltCore._setError が\n * `requestPermission()` の catch で `{ error: e }` を渡す。`e` は生の Error/reason)。\n *\n * したがって derive は「wrap された生の値」から name/message を取り出す。また tilt は\n * \"unsupported\"(capability-missing)経路を **持たない**: `DeviceOrientationEvent` や\n * その `requestPermission` が無い環境では error にせず `\"granted\"` に倒して error を\n * クリアする(docs/device-orientation-tag-design.md §3)。よって capability-missing の\n * code / branch は生成しない(到達不能・dead code を避ける)。error として _setError に\n * 届くのは iOS の `requestPermission()` reject だけで、その name は実権限拒否なら\n * `NotAllowedError`、gesture 文脈外等なら汎用 `Error` になる。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した tilt error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_TILT_ERROR_CODE = {\n /** `NotAllowedError` — iOS の Device Orientation 権限拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の `requestPermission()` reject(gesture 文脈外 / 想定外の失敗)。 */\n TiltError: \"tilt-error\",\n} as const;\n\n/**\n * tilt の失敗(`_setError` に渡る `{ error: <生の reason> }`)を serializable な error\n * taxonomy に写す。name は wrap された reason の `Error.name`、message はその `.message`\n * (無ければ `String(...)`)。\n *\n * - `NotAllowedError` は iOS の権限拒否 → phase=\"start\" / not-allowed。retry で回復しない。\n * - それ以外(gesture 文脈外の汎用 `Error`、非 Error reason 等)→ phase=\"execute\" /\n * tilt-error。\n *\n * capability-missing 経路は無い(上のヘッダ参照): 非対応環境は error ではなく\n * `\"granted\"` へ倒れるため、ここには到達しない。\n */\nexport function deriveTiltErrorInfo(detail: { error?: any }): WcsIoErrorInfo {\n const name: string | undefined = detail.error?.name;\n const message: string = detail.error?.message ?? String(detail.error);\n if (name === \"NotAllowedError\") {\n return { code: WCS_TILT_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_TILT_ERROR_CODE.TiltError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveTiltErrorInfo } from \"./tiltCapabilities.js\";\n\ninterface DeviceOrientationEventCtor {\n requestPermission?: () => Promise<\"granted\" | \"denied\">;\n}\n\ninterface WcsTiltSnapshot {\n alpha: number | null;\n beta: number | null;\n gamma: number | null;\n absolute: boolean | null;\n}\n\nconst UNSUPPORTED_SNAPSHOT: WcsTiltSnapshot = Object.freeze({\n alpha: null,\n beta: null,\n gamma: null,\n absolute: null,\n});\n\n/**\n * Headless Device Orientation primitive. A thin, framework-agnostic wrapper\n * around `window`'s `deviceorientation` event exposed through the wc-bindable\n * protocol.\n *\n * The batch2 sibling of `@wcstack/idle` (docs/device-orientation-tag-design.md).\n * Unlike Idle Detection, there is no matching Permissions API entry for this\n * feature (`navigator.permissions.query` has no \"device-orientation\" name), so\n * `permissionState` must be tracked **locally** rather than composed with\n * `<wcs-permission>` — the defining asymmetry within batch2.\n *\n * No `_gen` generation guard: subscribing/unsubscribing to `deviceorientation`\n * (start/stop) is fully synchronous, so that path never needs one. This node\n * does have an async probe — `requestPermission()` awaits the static\n * `DeviceOrientationEvent.requestPermission()` — but its post-await write is\n * a benign `permissionState`/`error` value set + dispatch with no\n * subscription/resource management to race, so `_gen` is unneeded there too\n * (docs/device-orientation-tag-design.md §4, corrected after an earlier\n * revision mistakenly reused `@wcstack/network`'s \"no async probe at all\"\n * rationale).\n */\nexport class TiltCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"alpha\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.alpha },\n { name: \"beta\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.beta },\n { name: \"gamma\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.gamma },\n { name: \"absolute\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.absolute },\n { name: \"permissionState\", event: \"wcs-tilt:permission-changed\", semantics: \"state\" },\n // never-throw (§3.6): requestPermission() failures land here instead of\n // rejecting/throwing. Mirrors idle (same batch2) and the accelerometer\n // family (batch5) — see docs/io-node-batch-implementation-plan.md.\n { name: \"error\", event: \"wcs-tilt:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error.error` (the wrapped rejection's\n // Error.name); the existing `error` property/event are unchanged. Fires\n // wcs-tilt:error-info-changed. No lane — this is a monitor node.\n { name: \"errorInfo\", event: \"wcs-tilt:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\" },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _snapshot: WcsTiltSnapshot = UNSUPPORTED_SNAPSHOT;\n private _permissionState: TiltPermissionState = \"unknown\";\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _subscribed = false;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate.\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 alpha(): number | null {\n return this._snapshot.alpha;\n }\n\n get beta(): number | null {\n return this._snapshot.beta;\n }\n\n get gamma(): number | null {\n return this._snapshot.gamma;\n }\n\n get absolute(): boolean | null {\n return this._snapshot.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._permissionState;\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-tilt: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: like `<wcs-idle>`,\n // this Core deliberately does NOT auto-start on connect (§6) on platforms\n // that gate deviceorientation behind requestPermission().\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _deviceOrientationEventCtor(): DeviceOrientationEventCtor | undefined {\n const g = globalThis as any;\n return typeof g.DeviceOrientationEvent !== \"undefined\" ? g.DeviceOrientationEvent : undefined;\n }\n\n private _setPermissionState(state: TiltPermissionState): void {\n if (this._permissionState === state) return;\n this._permissionState = state;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:permission-changed\", {\n detail: state,\n bubbles: true,\n }));\n }\n\n private _setError(error: any): 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 // wrapped rejection (or null on clear). Fires before the `error` event so an\n // observer binding both sees the classification first, mirroring the io-node\n // family.\n this._commitErrorInfo(error === null ? null : deriveTiltErrorInfo(error));\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (which already reference-guards on the error\n // object), 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-tilt:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps iOS 13+ Safari's static, gesture-gated\n * `DeviceOrientationEvent.requestPermission()`. On platforms without this\n * gate (Android Chrome, desktop) there is nothing to ask, so this resolves\n * to `\"granted\"` immediately without querying anything — callers can write\n * one `requestPermission()` → `start()` flow that works everywhere\n * (docs/device-orientation-tag-design.md §3).\n *\n * never-throw (§3.6): a gesture-context rejection resolves to `\"denied\"`\n * and the raw error lands in `error` instead of propagating. Mirrors\n * `<wcs-idle>`'s `requestPermission()` (docs/idle-detection-tag-design.md\n * §4.1) — any settled (non-throwing) outcome supersedes a stale `error`\n * from an earlier attempt.\n */\n async requestPermission(): Promise<TiltPermissionState> {\n const Ctor = this._deviceOrientationEventCtor();\n if (typeof Ctor?.requestPermission !== \"function\") {\n this._setError(null);\n this._setPermissionState(\"granted\");\n return \"granted\";\n }\n try {\n const result = await Ctor.requestPermission();\n const state: TiltPermissionState = result === \"granted\" ? \"granted\" : \"denied\";\n this._setError(null);\n this._setPermissionState(state);\n return state;\n } catch (e) {\n // never-throw: a gesture-context rejection resolves to \"denied\".\n this._setError({ error: e });\n this._setPermissionState(\"denied\");\n return \"denied\";\n }\n }\n\n /** Subscribe to `deviceorientation`. Idempotent — a second start() while already subscribed is a no-op. */\n start(): void {\n if (this._subscribed) return;\n this._subscribed = true;\n globalThis.window?.addEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n /** Unsubscribe from `deviceorientation`. Safe to call when not started. */\n stop(): void {\n if (!this._subscribed) return;\n this._subscribed = false;\n globalThis.window?.removeEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n private _onOrientation = (event: DeviceOrientationEvent): void => {\n this._apply({\n alpha: event.alpha,\n beta: event.beta,\n gamma: event.gamma,\n absolute: event.absolute,\n });\n };\n\n // Same-value guard (§3.3 MUST).\n private _apply(next: WcsTiltSnapshot): void {\n const prev = this._snapshot;\n if (\n prev.alpha === next.alpha &&\n prev.beta === next.beta &&\n prev.gamma === next.gamma &&\n prev.absolute === next.absolute\n ) {\n return;\n }\n this._snapshot = next;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:change\", {\n detail: next,\n bubbles: true,\n }));\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 { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { TiltCore } from \"../core/TiltCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-tilt>` — declarative Device Orientation API monitor.\n *\n * Named `tilt` (not `orientation`/`device-orientation`) to avoid colliding\n * with `<wcs-screen-orientation>` (docs/device-orientation-tag-design.md §9).\n *\n * Does NOT auto-start on connect, mirroring `<wcs-idle>`: on iOS, subscribing\n * before permission is granted silently receives no events. Callers drive\n * `requestPermission()` → `start()` explicitly.\n */\nexport class WcsTilt extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...TiltCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: TiltCore.wcBindable.commands,\n };\n\n private _core: TiltCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new TiltCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-tilt: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 (async-io-node-guidelines.md §3.6): attachInternals is absent\n // 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 // --- Core delegated getters ---\n\n get alpha(): number | null {\n return this._core.alpha;\n }\n\n get beta(): number | null {\n return this._core.beta;\n }\n\n get gamma(): number | null {\n return this._core.gamma;\n }\n\n get absolute(): boolean | null {\n return this._core.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._core.permissionState;\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<TiltPermissionState> {\n return this._core.requestPermission();\n }\n\n start(): void {\n this._core.start();\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 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 bootstrapTilt(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n","import { WcsTilt } from \"./components/Tilt.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.tilt)) {\n registry.define(config.tagNames.tilt, WcsTilt);\n }\n}\n"],"names":["config","tagNames","tilt","WCS_TILT_ERROR_CODE","UNSUPPORTED_SNAPSHOT","Object","freeze","alpha","beta","gamma","absolute","TiltCore","EventTarget","static","protocol","version","properties","name","event","semantics","getter","e","detail","commands","async","_target","_snapshot","_permissionState","_error","_errorInfo","_subscribed","_ready","Promise","resolve","constructor","target","super","this","ready","permissionState","error","errorInfo","observe","dispose","stop","_deviceOrientationEventCtor","g","globalThis","DeviceOrientationEvent","undefined","_setPermissionState","state","dispatchEvent","CustomEvent","bubbles","_setError","_commitErrorInfo","message","String","code","phase","recoverable","deriveTiltErrorInfo","info","requestPermission","Ctor","start","window","addEventListener","_onOrientation","removeEventListener","_apply","next","prev","hasAccessorOnPrototype","proto","getPrototypeOf","descriptor","getOwnPropertyDescriptor","get","set","WcsTilt","HTMLElement","wcBindable","inputs","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","d","debugStates","states","attachInternals","internals","add","delete","map","toStates","entries","debug","hasAttribute","on","toggleAttribute","connectedCallbackPromise","connectedCallback","element","declaration","input","prototype","hasOwnProperty","call","record","value","upgradeProperties","style","display","disconnectedCallback","registry","customElements","define","registerComponents"],"mappings":"AAQA,MA0BaA,EA1BoB,CAC/BC,SAAU,CACRC,KAAM,aCiBGC,EAEC,cAFDA,EAIA,aChBb,MAAMC,EAAwCC,OAAOC,OAAO,CAC1DC,MAAO,KACPC,KAAM,KACNC,MAAO,KACPC,SAAU,OAwBN,MAAOC,UAAiBC,YAC5BC,kBAAiC,CAC/BC,SAAU,cACVC,QAAS,EACTC,WAAY,CACV,CAAEC,KAAM,QAASC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOf,OAC/G,CAAEU,KAAM,OAAQC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOd,MAC9G,CAAES,KAAM,QAASC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOb,OAC/G,CAAEQ,KAAM,WAAYC,MAAO,kBAAmBC,UAAW,QAASC,OAASC,GAAcA,EAAkBC,OAAOZ,UACl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MAClBA,KAAK8E,MAAMC,QAAU,OACrB/E,KAAKiD,0BAA4BjD,KAAKgD,MAAM3C,SAC9C,CAEA,oBAAA2E,GACEhF,KAAKgD,MAAM1C,SACb,ECtII,IAAsD2E,GCItD,SAA6BA,EAAkCC,gBAC9DD,EAASvC,IAAI/E,EAAOC,SAASC,OAChCoH,EAASE,OAAOxH,EAAOC,SAASC,KAAM+E,EAE1C,CDJEwC,CAAmBH"}
package/dist/index.d.ts CHANGED
@@ -88,7 +88,7 @@ interface WcsTiltCoreValues {
88
88
  */
89
89
  type WcsTiltValues = WcsTiltCoreValues;
90
90
 
91
- declare function bootstrapTilt(userConfig?: IWritableConfig): void;
91
+ declare function bootstrapTilt(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void;
92
92
 
93
93
  declare function getConfig(): IConfig;
94
94
 
package/dist/index.esm.js CHANGED
@@ -469,17 +469,22 @@ class WcsTilt extends HTMLElement {
469
469
  }
470
470
  }
471
471
 
472
- function registerComponents() {
473
- if (!customElements.get(config.tagNames.tilt)) {
474
- customElements.define(config.tagNames.tilt, WcsTilt);
472
+ /**
473
+ * Register this package's tags. Pass a scoped `CustomElementRegistry` to define
474
+ * them for a single shadow tree -- scoped registries do not inherit the global
475
+ * one, so a tree using one needs its own definitions.
476
+ */
477
+ function registerComponents(registry = customElements) {
478
+ if (!registry.get(config.tagNames.tilt)) {
479
+ registry.define(config.tagNames.tilt, WcsTilt);
475
480
  }
476
481
  }
477
482
 
478
- function bootstrapTilt(userConfig) {
483
+ function bootstrapTilt(userConfig, registry) {
479
484
  if (userConfig) {
480
485
  setConfig(userConfig);
481
486
  }
482
- registerComponents();
487
+ registerComponents(registry);
483
488
  }
484
489
 
485
490
  export { TiltCore, WCS_TILT_ERROR_CODE, WcsTilt, bootstrapTilt, getConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/config.ts","../src/core/tiltCapabilities.ts","../src/core/TiltCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Tilt.ts","../src/registerComponents.ts","../src/bootstrapTilt.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n tilt: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n tilt: \"wcs-tilt\",\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 * tiltCapabilities.ts\n *\n * Tilt(Device Orientation)node 固有の error code(taxonomy)と derivation。汎用の\n * error info 型は `./platformCapability.js`(/io-core/ から copy-distribution される\n * 生成ファイル)から import する。tilt は監視系(deviceorientation の subscribe/\n * unsubscribe)で競合する operation を持たないため lane は持たず、error taxonomy\n * (errorInfo)のみを採用する。\n *\n * sensor 4 兄弟(accelerometer / gyroscope / magnetometer / ambient-light-sensor)と\n * 違い、tilt の error 面は **異なる shape** を持つ:\n * - sensor 族の error detail は `{ error: <Error.name>, message }`(name/message は文字列)。\n * - tilt の error detail は `{ error: <生の rejection reason> }`(TiltCore._setError が\n * `requestPermission()` の catch で `{ error: e }` を渡す。`e` は生の Error/reason)。\n *\n * したがって derive は「wrap された生の値」から name/message を取り出す。また tilt は\n * \"unsupported\"(capability-missing)経路を **持たない**: `DeviceOrientationEvent` や\n * その `requestPermission` が無い環境では error にせず `\"granted\"` に倒して error を\n * クリアする(docs/device-orientation-tag-design.md §3)。よって capability-missing の\n * code / branch は生成しない(到達不能・dead code を避ける)。error として _setError に\n * 届くのは iOS の `requestPermission()` reject だけで、その name は実権限拒否なら\n * `NotAllowedError`、gesture 文脈外等なら汎用 `Error` になる。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した tilt error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_TILT_ERROR_CODE = {\n /** `NotAllowedError` — iOS の Device Orientation 権限拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の `requestPermission()` reject(gesture 文脈外 / 想定外の失敗)。 */\n TiltError: \"tilt-error\",\n} as const;\n\n/**\n * tilt の失敗(`_setError` に渡る `{ error: <生の reason> }`)を serializable な error\n * taxonomy に写す。name は wrap された reason の `Error.name`、message はその `.message`\n * (無ければ `String(...)`)。\n *\n * - `NotAllowedError` は iOS の権限拒否 → phase=\"start\" / not-allowed。retry で回復しない。\n * - それ以外(gesture 文脈外の汎用 `Error`、非 Error reason 等)→ phase=\"execute\" /\n * tilt-error。\n *\n * capability-missing 経路は無い(上のヘッダ参照): 非対応環境は error ではなく\n * `\"granted\"` へ倒れるため、ここには到達しない。\n */\nexport function deriveTiltErrorInfo(detail: { error?: any }): WcsIoErrorInfo {\n const name: string | undefined = detail.error?.name;\n const message: string = detail.error?.message ?? String(detail.error);\n if (name === \"NotAllowedError\") {\n return { code: WCS_TILT_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_TILT_ERROR_CODE.TiltError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveTiltErrorInfo } from \"./tiltCapabilities.js\";\n\ninterface DeviceOrientationEventCtor {\n requestPermission?: () => Promise<\"granted\" | \"denied\">;\n}\n\ninterface WcsTiltSnapshot {\n alpha: number | null;\n beta: number | null;\n gamma: number | null;\n absolute: boolean | null;\n}\n\nconst UNSUPPORTED_SNAPSHOT: WcsTiltSnapshot = Object.freeze({\n alpha: null,\n beta: null,\n gamma: null,\n absolute: null,\n});\n\n/**\n * Headless Device Orientation primitive. A thin, framework-agnostic wrapper\n * around `window`'s `deviceorientation` event exposed through the wc-bindable\n * protocol.\n *\n * The batch2 sibling of `@wcstack/idle` (docs/device-orientation-tag-design.md).\n * Unlike Idle Detection, there is no matching Permissions API entry for this\n * feature (`navigator.permissions.query` has no \"device-orientation\" name), so\n * `permissionState` must be tracked **locally** rather than composed with\n * `<wcs-permission>` — the defining asymmetry within batch2.\n *\n * No `_gen` generation guard: subscribing/unsubscribing to `deviceorientation`\n * (start/stop) is fully synchronous, so that path never needs one. This node\n * does have an async probe — `requestPermission()` awaits the static\n * `DeviceOrientationEvent.requestPermission()` — but its post-await write is\n * a benign `permissionState`/`error` value set + dispatch with no\n * subscription/resource management to race, so `_gen` is unneeded there too\n * (docs/device-orientation-tag-design.md §4, corrected after an earlier\n * revision mistakenly reused `@wcstack/network`'s \"no async probe at all\"\n * rationale).\n */\nexport class TiltCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"alpha\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.alpha },\n { name: \"beta\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.beta },\n { name: \"gamma\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.gamma },\n { name: \"absolute\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.absolute },\n { name: \"permissionState\", event: \"wcs-tilt:permission-changed\", semantics: \"state\" },\n // never-throw (§3.6): requestPermission() failures land here instead of\n // rejecting/throwing. Mirrors idle (same batch2) and the accelerometer\n // family (batch5) — see docs/io-node-batch-implementation-plan.md.\n { name: \"error\", event: \"wcs-tilt:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error.error` (the wrapped rejection's\n // Error.name); the existing `error` property/event are unchanged. Fires\n // wcs-tilt:error-info-changed. No lane — this is a monitor node.\n { name: \"errorInfo\", event: \"wcs-tilt:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\" },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _snapshot: WcsTiltSnapshot = UNSUPPORTED_SNAPSHOT;\n private _permissionState: TiltPermissionState = \"unknown\";\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _subscribed = false;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate.\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 alpha(): number | null {\n return this._snapshot.alpha;\n }\n\n get beta(): number | null {\n return this._snapshot.beta;\n }\n\n get gamma(): number | null {\n return this._snapshot.gamma;\n }\n\n get absolute(): boolean | null {\n return this._snapshot.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._permissionState;\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-tilt: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: like `<wcs-idle>`,\n // this Core deliberately does NOT auto-start on connect (§6) on platforms\n // that gate deviceorientation behind requestPermission().\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _deviceOrientationEventCtor(): DeviceOrientationEventCtor | undefined {\n const g = globalThis as any;\n return typeof g.DeviceOrientationEvent !== \"undefined\" ? g.DeviceOrientationEvent : undefined;\n }\n\n private _setPermissionState(state: TiltPermissionState): void {\n if (this._permissionState === state) return;\n this._permissionState = state;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:permission-changed\", {\n detail: state,\n bubbles: true,\n }));\n }\n\n private _setError(error: any): 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 // wrapped rejection (or null on clear). Fires before the `error` event so an\n // observer binding both sees the classification first, mirroring the io-node\n // family.\n this._commitErrorInfo(error === null ? null : deriveTiltErrorInfo(error));\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (which already reference-guards on the error\n // object), 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-tilt:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps iOS 13+ Safari's static, gesture-gated\n * `DeviceOrientationEvent.requestPermission()`. On platforms without this\n * gate (Android Chrome, desktop) there is nothing to ask, so this resolves\n * to `\"granted\"` immediately without querying anything — callers can write\n * one `requestPermission()` → `start()` flow that works everywhere\n * (docs/device-orientation-tag-design.md §3).\n *\n * never-throw (§3.6): a gesture-context rejection resolves to `\"denied\"`\n * and the raw error lands in `error` instead of propagating. Mirrors\n * `<wcs-idle>`'s `requestPermission()` (docs/idle-detection-tag-design.md\n * §4.1) — any settled (non-throwing) outcome supersedes a stale `error`\n * from an earlier attempt.\n */\n async requestPermission(): Promise<TiltPermissionState> {\n const Ctor = this._deviceOrientationEventCtor();\n if (typeof Ctor?.requestPermission !== \"function\") {\n this._setError(null);\n this._setPermissionState(\"granted\");\n return \"granted\";\n }\n try {\n const result = await Ctor.requestPermission();\n const state: TiltPermissionState = result === \"granted\" ? \"granted\" : \"denied\";\n this._setError(null);\n this._setPermissionState(state);\n return state;\n } catch (e) {\n // never-throw: a gesture-context rejection resolves to \"denied\".\n this._setError({ error: e });\n this._setPermissionState(\"denied\");\n return \"denied\";\n }\n }\n\n /** Subscribe to `deviceorientation`. Idempotent — a second start() while already subscribed is a no-op. */\n start(): void {\n if (this._subscribed) return;\n this._subscribed = true;\n globalThis.window?.addEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n /** Unsubscribe from `deviceorientation`. Safe to call when not started. */\n stop(): void {\n if (!this._subscribed) return;\n this._subscribed = false;\n globalThis.window?.removeEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n private _onOrientation = (event: DeviceOrientationEvent): void => {\n this._apply({\n alpha: event.alpha,\n beta: event.beta,\n gamma: event.gamma,\n absolute: event.absolute,\n });\n };\n\n // Same-value guard (§3.3 MUST).\n private _apply(next: WcsTiltSnapshot): void {\n const prev = this._snapshot;\n if (\n prev.alpha === next.alpha &&\n prev.beta === next.beta &&\n prev.gamma === next.gamma &&\n prev.absolute === next.absolute\n ) {\n return;\n }\n this._snapshot = next;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:change\", {\n detail: next,\n bubbles: true,\n }));\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 { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { TiltCore } from \"../core/TiltCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-tilt>` — declarative Device Orientation API monitor.\n *\n * Named `tilt` (not `orientation`/`device-orientation`) to avoid colliding\n * with `<wcs-screen-orientation>` (docs/device-orientation-tag-design.md §9).\n *\n * Does NOT auto-start on connect, mirroring `<wcs-idle>`: on iOS, subscribing\n * before permission is granted silently receives no events. Callers drive\n * `requestPermission()` → `start()` explicitly.\n */\nexport class WcsTilt extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...TiltCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: TiltCore.wcBindable.commands,\n };\n\n private _core: TiltCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new TiltCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-tilt: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 (async-io-node-guidelines.md §3.6): attachInternals is absent\n // 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 // --- Core delegated getters ---\n\n get alpha(): number | null {\n return this._core.alpha;\n }\n\n get beta(): number | null {\n return this._core.beta;\n }\n\n get gamma(): number | null {\n return this._core.gamma;\n }\n\n get absolute(): boolean | null {\n return this._core.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._core.permissionState;\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<TiltPermissionState> {\n return this._core.requestPermission();\n }\n\n start(): void {\n this._core.start();\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 this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { WcsTilt } from \"./components/Tilt.js\";\nimport { config } from \"./config.js\";\n\nexport function registerComponents(): void {\n if (!customElements.get(config.tagNames.tilt)) {\n customElements.define(config.tagNames.tilt, WcsTilt);\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapTilt(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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O,IAAI,CAAC,KAAK,CAAC,SAAS;IAC7B;AAEA,IAAA,IAAI,wBAAwB,GAAA;QAC1B,OAAO,IAAI,CAAC,yBAAyB;IACvC;;IAIA,iBAAiB,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;IACvC;IAEA,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;IACpB;IAEA,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;IACnB;;IAIA,iBAAiB,GAAA;;QAEf,iBAAiB,CAAC,IAAI,CAAC;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM;QAC3B,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;IACvD;IAEA,oBAAoB,GAAA;AAClB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;IACtB;;;SCvIc,kBAAkB,GAAA;AAChC,IAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QAC7C,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACtD;AACF;;ACHM,SAAU,aAAa,CAAC,UAA4B,EAAA;IACxD,IAAI,UAAU,EAAE;QACd,SAAS,CAAC,UAAU,CAAC;IACvB;AACA,IAAA,kBAAkB,EAAE;AACtB;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/config.ts","../src/core/tiltCapabilities.ts","../src/core/TiltCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Tilt.ts","../src/registerComponents.ts","../src/bootstrapTilt.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n tilt: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n tilt: \"wcs-tilt\",\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 * tiltCapabilities.ts\n *\n * Tilt(Device Orientation)node 固有の error code(taxonomy)と derivation。汎用の\n * error info 型は `./platformCapability.js`(/io-core/ から copy-distribution される\n * 生成ファイル)から import する。tilt は監視系(deviceorientation の subscribe/\n * unsubscribe)で競合する operation を持たないため lane は持たず、error taxonomy\n * (errorInfo)のみを採用する。\n *\n * sensor 4 兄弟(accelerometer / gyroscope / magnetometer / ambient-light-sensor)と\n * 違い、tilt の error 面は **異なる shape** を持つ:\n * - sensor 族の error detail は `{ error: <Error.name>, message }`(name/message は文字列)。\n * - tilt の error detail は `{ error: <生の rejection reason> }`(TiltCore._setError が\n * `requestPermission()` の catch で `{ error: e }` を渡す。`e` は生の Error/reason)。\n *\n * したがって derive は「wrap された生の値」から name/message を取り出す。また tilt は\n * \"unsupported\"(capability-missing)経路を **持たない**: `DeviceOrientationEvent` や\n * その `requestPermission` が無い環境では error にせず `\"granted\"` に倒して error を\n * クリアする(docs/device-orientation-tag-design.md §3)。よって capability-missing の\n * code / branch は生成しない(到達不能・dead code を避ける)。error として _setError に\n * 届くのは iOS の `requestPermission()` reject だけで、その name は実権限拒否なら\n * `NotAllowedError`、gesture 文脈外等なら汎用 `Error` になる。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 安定した tilt error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_TILT_ERROR_CODE = {\n /** `NotAllowedError` — iOS の Device Orientation 権限拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の `requestPermission()` reject(gesture 文脈外 / 想定外の失敗)。 */\n TiltError: \"tilt-error\",\n} as const;\n\n/**\n * tilt の失敗(`_setError` に渡る `{ error: <生の reason> }`)を serializable な error\n * taxonomy に写す。name は wrap された reason の `Error.name`、message はその `.message`\n * (無ければ `String(...)`)。\n *\n * - `NotAllowedError` は iOS の権限拒否 → phase=\"start\" / not-allowed。retry で回復しない。\n * - それ以外(gesture 文脈外の汎用 `Error`、非 Error reason 等)→ phase=\"execute\" /\n * tilt-error。\n *\n * capability-missing 経路は無い(上のヘッダ参照): 非対応環境は error ではなく\n * `\"granted\"` へ倒れるため、ここには到達しない。\n */\nexport function deriveTiltErrorInfo(detail: { error?: any }): WcsIoErrorInfo {\n const name: string | undefined = detail.error?.name;\n const message: string = detail.error?.message ?? String(detail.error);\n if (name === \"NotAllowedError\") {\n return { code: WCS_TILT_ERROR_CODE.NotAllowed, phase: \"start\", recoverable: false, message };\n }\n return { code: WCS_TILT_ERROR_CODE.TiltError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveTiltErrorInfo } from \"./tiltCapabilities.js\";\n\ninterface DeviceOrientationEventCtor {\n requestPermission?: () => Promise<\"granted\" | \"denied\">;\n}\n\ninterface WcsTiltSnapshot {\n alpha: number | null;\n beta: number | null;\n gamma: number | null;\n absolute: boolean | null;\n}\n\nconst UNSUPPORTED_SNAPSHOT: WcsTiltSnapshot = Object.freeze({\n alpha: null,\n beta: null,\n gamma: null,\n absolute: null,\n});\n\n/**\n * Headless Device Orientation primitive. A thin, framework-agnostic wrapper\n * around `window`'s `deviceorientation` event exposed through the wc-bindable\n * protocol.\n *\n * The batch2 sibling of `@wcstack/idle` (docs/device-orientation-tag-design.md).\n * Unlike Idle Detection, there is no matching Permissions API entry for this\n * feature (`navigator.permissions.query` has no \"device-orientation\" name), so\n * `permissionState` must be tracked **locally** rather than composed with\n * `<wcs-permission>` — the defining asymmetry within batch2.\n *\n * No `_gen` generation guard: subscribing/unsubscribing to `deviceorientation`\n * (start/stop) is fully synchronous, so that path never needs one. This node\n * does have an async probe — `requestPermission()` awaits the static\n * `DeviceOrientationEvent.requestPermission()` — but its post-await write is\n * a benign `permissionState`/`error` value set + dispatch with no\n * subscription/resource management to race, so `_gen` is unneeded there too\n * (docs/device-orientation-tag-design.md §4, corrected after an earlier\n * revision mistakenly reused `@wcstack/network`'s \"no async probe at all\"\n * rationale).\n */\nexport class TiltCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"alpha\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.alpha },\n { name: \"beta\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.beta },\n { name: \"gamma\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.gamma },\n { name: \"absolute\", event: \"wcs-tilt:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.absolute },\n { name: \"permissionState\", event: \"wcs-tilt:permission-changed\", semantics: \"state\" },\n // never-throw (§3.6): requestPermission() failures land here instead of\n // rejecting/throwing. Mirrors idle (same batch2) and the accelerometer\n // family (batch5) — see docs/io-node-batch-implementation-plan.md.\n { name: \"error\", event: \"wcs-tilt:error\", semantics: \"state\" },\n // Serializable failure taxonomy (stable code / phase / recoverable), or null.\n // Additive bindable output derived from `error.error` (the wrapped rejection's\n // Error.name); the existing `error` property/event are unchanged. Fires\n // wcs-tilt:error-info-changed. No lane — this is a monitor node.\n { name: \"errorInfo\", event: \"wcs-tilt:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestPermission\", async: true },\n { name: \"start\" },\n { name: \"stop\" },\n ],\n };\n\n private _target: EventTarget;\n private _snapshot: WcsTiltSnapshot = UNSUPPORTED_SNAPSHOT;\n private _permissionState: TiltPermissionState = \"unknown\";\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n private _subscribed = false;\n\n // SSR (§3.8): never auto-starts on connect, so there is no probe to await —\n // readiness is always immediate.\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 alpha(): number | null {\n return this._snapshot.alpha;\n }\n\n get beta(): number | null {\n return this._snapshot.beta;\n }\n\n get gamma(): number | null {\n return this._snapshot.gamma;\n }\n\n get absolute(): boolean | null {\n return this._snapshot.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._permissionState;\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-tilt: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: like `<wcs-idle>`,\n // this Core deliberately does NOT auto-start on connect (§6) on platforms\n // that gate deviceorientation behind requestPermission().\n observe(): Promise<void> {\n return this._ready;\n }\n\n dispose(): void {\n this.stop();\n }\n\n private _deviceOrientationEventCtor(): DeviceOrientationEventCtor | undefined {\n const g = globalThis as any;\n return typeof g.DeviceOrientationEvent !== \"undefined\" ? g.DeviceOrientationEvent : undefined;\n }\n\n private _setPermissionState(state: TiltPermissionState): void {\n if (this._permissionState === state) return;\n this._permissionState = state;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:permission-changed\", {\n detail: state,\n bubbles: true,\n }));\n }\n\n private _setError(error: any): 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 // wrapped rejection (or null on clear). Fires before the `error` event so an\n // observer binding both sees the classification first, mirroring the io-node\n // family.\n this._commitErrorInfo(error === null ? null : deriveTiltErrorInfo(error));\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (which already reference-guards on the error\n // object), 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-tilt:error-info-changed\", {\n detail: info,\n bubbles: true,\n }));\n }\n\n /**\n * Wraps iOS 13+ Safari's static, gesture-gated\n * `DeviceOrientationEvent.requestPermission()`. On platforms without this\n * gate (Android Chrome, desktop) there is nothing to ask, so this resolves\n * to `\"granted\"` immediately without querying anything — callers can write\n * one `requestPermission()` → `start()` flow that works everywhere\n * (docs/device-orientation-tag-design.md §3).\n *\n * never-throw (§3.6): a gesture-context rejection resolves to `\"denied\"`\n * and the raw error lands in `error` instead of propagating. Mirrors\n * `<wcs-idle>`'s `requestPermission()` (docs/idle-detection-tag-design.md\n * §4.1) — any settled (non-throwing) outcome supersedes a stale `error`\n * from an earlier attempt.\n */\n async requestPermission(): Promise<TiltPermissionState> {\n const Ctor = this._deviceOrientationEventCtor();\n if (typeof Ctor?.requestPermission !== \"function\") {\n this._setError(null);\n this._setPermissionState(\"granted\");\n return \"granted\";\n }\n try {\n const result = await Ctor.requestPermission();\n const state: TiltPermissionState = result === \"granted\" ? \"granted\" : \"denied\";\n this._setError(null);\n this._setPermissionState(state);\n return state;\n } catch (e) {\n // never-throw: a gesture-context rejection resolves to \"denied\".\n this._setError({ error: e });\n this._setPermissionState(\"denied\");\n return \"denied\";\n }\n }\n\n /** Subscribe to `deviceorientation`. Idempotent — a second start() while already subscribed is a no-op. */\n start(): void {\n if (this._subscribed) return;\n this._subscribed = true;\n globalThis.window?.addEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n /** Unsubscribe from `deviceorientation`. Safe to call when not started. */\n stop(): void {\n if (!this._subscribed) return;\n this._subscribed = false;\n globalThis.window?.removeEventListener(\"deviceorientation\", this._onOrientation as EventListener);\n }\n\n private _onOrientation = (event: DeviceOrientationEvent): void => {\n this._apply({\n alpha: event.alpha,\n beta: event.beta,\n gamma: event.gamma,\n absolute: event.absolute,\n });\n };\n\n // Same-value guard (§3.3 MUST).\n private _apply(next: WcsTiltSnapshot): void {\n const prev = this._snapshot;\n if (\n prev.alpha === next.alpha &&\n prev.beta === next.beta &&\n prev.gamma === next.gamma &&\n prev.absolute === next.absolute\n ) {\n return;\n }\n this._snapshot = next;\n this._target.dispatchEvent(new CustomEvent(\"wcs-tilt:change\", {\n detail: next,\n bubbles: true,\n }));\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 { IWcBindable, TiltPermissionState } from \"../types.js\";\nimport { TiltCore } from \"../core/TiltCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-tilt>` — declarative Device Orientation API monitor.\n *\n * Named `tilt` (not `orientation`/`device-orientation`) to avoid colliding\n * with `<wcs-screen-orientation>` (docs/device-orientation-tag-design.md §9).\n *\n * Does NOT auto-start on connect, mirroring `<wcs-idle>`: on iOS, subscribing\n * before permission is granted silently receives no events. Callers drive\n * `requestPermission()` → `start()` explicitly.\n */\nexport class WcsTilt extends HTMLElement {\n static hasConnectedCallbackPromise = true;\n\n static wcBindable: IWcBindable = {\n ...TiltCore.wcBindable,\n inputs: [],\n // Core の commands をそのまま継承(単一情報源)。\n commands: TiltCore.wcBindable.commands,\n };\n\n private _core: TiltCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new TiltCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-tilt: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 (async-io-node-guidelines.md §3.6): attachInternals is absent\n // 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 // --- Core delegated getters ---\n\n get alpha(): number | null {\n return this._core.alpha;\n }\n\n get beta(): number | null {\n return this._core.beta;\n }\n\n get gamma(): number | null {\n return this._core.gamma;\n }\n\n get absolute(): boolean | null {\n return this._core.absolute;\n }\n\n get permissionState(): TiltPermissionState {\n return this._core.permissionState;\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<TiltPermissionState> {\n return this._core.requestPermission();\n }\n\n start(): void {\n this._core.start();\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 this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n}\n","import { WcsTilt } from \"./components/Tilt.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.tilt)) {\n registry.define(config.tagNames.tilt, WcsTilt);\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapTilt(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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A,IAAI,wBAAwB,GAAA;QAC1B,OAAO,IAAI,CAAC,yBAAyB;IACvC;;IAIA,iBAAiB,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE;IACvC;IAEA,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;IACpB;IAEA,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;IACnB;;IAIA,iBAAiB,GAAA;;QAEf,iBAAiB,CAAC,IAAI,CAAC;AACvB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM;QAC3B,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;IACvD;IAEA,oBAAoB,GAAA;AAClB,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;IACtB;;;ACvIF;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,QAAA,GAAkC,cAAc,EAAA;AACjF,IAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,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/tilt",
3
- "version": "1.29.0",
3
+ "version": "1.31.0",
4
4
  "description": "Declarative Device Orientation component for Web Components. Framework-agnostic deviceorientation wrapper via wc-bindable-protocol.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.esm.js",