@wcstack/fullscreen 4.0.0-rc.8 → 4.0.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/README.ja.md +2 -0
- package/README.md +2 -0
- package/dist/auto.min.js +1 -1
- package/dist/auto.min.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +53 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -99,6 +99,8 @@ npm install @wcstack/fullscreen
|
|
|
99
99
|
| ---------- | ---- |
|
|
100
100
|
| `target` | `@wcstack/intersection` の `target` と同じ3モード解決: `"self"`、CSSセレクタ、または省略(最初の子要素)。 |
|
|
101
101
|
|
|
102
|
+
**`null` と `undefined`。** 属性に対応する入力 `target` は、`null` を「クリア」として扱います。属性を外し、`target` は既定値(最初の子要素)に戻ります。`undefined` は「値が無い」で、属性を最初の書き込みの前の状態 — マークアップに書かれた値、無ければ属性なし — に戻します。どちらも文字列 `"null"` / `"undefined"` として書くことはなく、何にも一致しないセレクタになってすべての要求が失敗することもありません(`@wcstack/state` は `undefined` を書きませんが、React 19 は値のあった prop を外したときに書き、直接の代入でも届きます)。
|
|
103
|
+
|
|
102
104
|
## `:state()` による CSS スタイリング
|
|
103
105
|
|
|
104
106
|
`<wcs-fullscreen>` は 1 つの boolean 出力ステートを
|
package/README.md
CHANGED
|
@@ -99,6 +99,8 @@ Every bound state path must be declared up front — `isFullscreen: false` here;
|
|
|
99
99
|
| ---------- | ------------ |
|
|
100
100
|
| `target` | Same 3-mode resolution as `@wcstack/intersection`'s `target`: `"self"`, a CSS selector, or omitted (first child). |
|
|
101
101
|
|
|
102
|
+
**`null` and `undefined`.** The `target` input, backed by its attribute, takes `null` as "clear": the attribute is removed and `target` falls back to its default, the first child. `undefined` means "no value supplied": the attribute goes back to what it was before the first write — the value written in the markup, or none. Neither is ever written as the string `"null"` / `"undefined"` (such a selector would resolve nothing, so every request would fail). (`@wcstack/state` never writes `undefined`; React 19 does when a prop that had a value is removed, and so can a direct assignment.)
|
|
103
|
+
|
|
102
104
|
## CSS styling with `:state()`
|
|
103
105
|
|
|
104
106
|
`<wcs-fullscreen>` reflects one boolean output state onto its
|
package/dist/auto.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={tagNames:{fullscreen:"wcs-fullscreen"}},t="capability-missing",r="invalid-argument",s="not-allowed",n="fullscreen-error";function i(e,i){const l=function(e){return"string"==typeof e?.message?e.message:String(e)}(e);if("capability-missing"===i)return{code:t,phase:"probe",recoverable:!1,message:l};if("invalid-argument"===i)return{code:r,phase:"start",recoverable:!1,message:l};const c=e?.name;return"NotAllowedError"===c||"TypeError"===c?{code:s,phase:"execute",recoverable:!0,message:l}:{code:n,phase:"execute",recoverable:!1,message:l}}class l extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"active",event:"wcs-fullscreen:change",semantics:"state",getter:e=>e.detail.active},{name:"error",event:"wcs-fullscreen:error",semantics:"state"},{name:"errorInfo",event:"wcs-fullscreen:error-info-changed",semantics:"state"}],commands:[{name:"requestFullscreen",async:!0},{name:"exitFullscreen",async:!0}]};_target;_active=!1;_error=null;_errorInfo=null;_resolvedTarget=null;_gen=0;_subscribed=!1;_ready=Promise.resolve();constructor(e){super(),this._target=e??this}get ready(){return this._ready}get active(){return this._active}get error(){return this._error}get errorInfo(){return this._errorInfo}setTarget(e){this._resolvedTarget=e,this._applyActive()}observe(){return this._subscribed||(this._subscribed=!0,document.addEventListener(this._fullscreenChangeEventName(),this._onFullscreenChange)),this._ready}dispose(){this._gen++,this._subscribed&&(this._subscribed=!1,document.removeEventListener(this._fullscreenChangeEventName(),this._onFullscreenChange))}async requestFullscreen(e){const t=++this._gen;if(this._resolvedTarget=e,!e)return void this._setError({message:"Fullscreen target could not be resolved."},"invalid-argument");const r=this._requestFullscreenFn(e);if(r)try{if(await r.call(e),t!==this._gen)return;this._setError(null),this._applyActive()}catch(e){if(t!==this._gen)return;this._setError(e)}else this._setError({message:"Fullscreen API is not supported."},"capability-missing")}async exitFullscreen(){if(null===this._fullscreenElement())return;const e=this._exitFullscreenFn();if(!e)return;const t=++this._gen;try{if(await e(),t!==this._gen)return;this._setError(null),this._applyActive()}catch(e){if(t!==this._gen)return;this._setError(e)}}_requestFullscreenFn(e){return this._elementFullscreenFn(e,"requestFullscreen")??this._elementFullscreenFn(e,"webkitRequestFullscreen")}_elementFullscreenFn(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:Element.prototype[t]}_exitFullscreenFn(){const e=document;return e.exitFullscreen?.bind(document)??e.webkitExitFullscreen?.bind(document)}_fullscreenElement(){const e=document;return e.fullscreenElement??e.webkitFullscreenElement??null}_fullscreenChangeEventName(){return"onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange"}_onFullscreenChange=()=>{this._applyActive()};_applyActive(){const e=null!==this._resolvedTarget&&this._fullscreenElement()===this._resolvedTarget;this._setActive(e)}_setActive(e){this._active!==e&&(this._active=e,this._target.dispatchEvent(new CustomEvent("wcs-fullscreen:change",{detail:{active:e},bubbles:!0})))}_setError(e,t){this._error!==e&&(this._error=e,this._commitErrorInfo(null===e?null:i(e,t)),this._target.dispatchEvent(new CustomEvent("wcs-fullscreen:error",{detail:e,bubbles:!0})))}_commitErrorInfo(e){this._errorInfo=e,this._target.dispatchEvent(new CustomEvent("wcs-fullscreen:error-info-changed",{detail:e,bubbles:!0}))}}function c(e,t){let r=Object.getPrototypeOf(e);for(;null!==r;){const e=Object.getOwnPropertyDescriptor(r,t);if(void 0!==e)return"function"==typeof e.get||"function"==typeof e.set;r=Object.getPrototypeOf(r)}return!1}
|
|
1
|
+
const e={tagNames:{fullscreen:"wcs-fullscreen"}},t="capability-missing",r="invalid-argument",s="not-allowed",n="fullscreen-error";function i(e,i){const l=function(e){return"string"==typeof e?.message?e.message:String(e)}(e);if("capability-missing"===i)return{code:t,phase:"probe",recoverable:!1,message:l};if("invalid-argument"===i)return{code:r,phase:"start",recoverable:!1,message:l};const c=e?.name;return"NotAllowedError"===c||"TypeError"===c?{code:s,phase:"execute",recoverable:!0,message:l}:{code:n,phase:"execute",recoverable:!1,message:l}}class l extends EventTarget{static wcBindable={protocol:"wc-bindable",version:1,properties:[{name:"active",event:"wcs-fullscreen:change",semantics:"state",getter:e=>e.detail.active},{name:"error",event:"wcs-fullscreen:error",semantics:"state"},{name:"errorInfo",event:"wcs-fullscreen:error-info-changed",semantics:"state"}],commands:[{name:"requestFullscreen",async:!0},{name:"exitFullscreen",async:!0}]};_target;_active=!1;_error=null;_errorInfo=null;_resolvedTarget=null;_gen=0;_subscribed=!1;_ready=Promise.resolve();constructor(e){super(),this._target=e??this}get ready(){return this._ready}get active(){return this._active}get error(){return this._error}get errorInfo(){return this._errorInfo}setTarget(e){this._resolvedTarget=e,this._applyActive()}observe(){return this._subscribed||(this._subscribed=!0,document.addEventListener(this._fullscreenChangeEventName(),this._onFullscreenChange)),this._ready}dispose(){this._gen++,this._subscribed&&(this._subscribed=!1,document.removeEventListener(this._fullscreenChangeEventName(),this._onFullscreenChange))}async requestFullscreen(e){const t=++this._gen;if(this._resolvedTarget=e,!e)return void this._setError({message:"Fullscreen target could not be resolved."},"invalid-argument");const r=this._requestFullscreenFn(e);if(r)try{if(await r.call(e),t!==this._gen)return;this._setError(null),this._applyActive()}catch(e){if(t!==this._gen)return;this._setError(e)}else this._setError({message:"Fullscreen API is not supported."},"capability-missing")}async exitFullscreen(){if(null===this._fullscreenElement())return;const e=this._exitFullscreenFn();if(!e)return;const t=++this._gen;try{if(await e(),t!==this._gen)return;this._setError(null),this._applyActive()}catch(e){if(t!==this._gen)return;this._setError(e)}}_requestFullscreenFn(e){return this._elementFullscreenFn(e,"requestFullscreen")??this._elementFullscreenFn(e,"webkitRequestFullscreen")}_elementFullscreenFn(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:Element.prototype[t]}_exitFullscreenFn(){const e=document;return e.exitFullscreen?.bind(document)??e.webkitExitFullscreen?.bind(document)}_fullscreenElement(){const e=document;return e.fullscreenElement??e.webkitFullscreenElement??null}_fullscreenChangeEventName(){return"onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange"}_onFullscreenChange=()=>{this._applyActive()};_applyActive(){const e=null!==this._resolvedTarget&&this._fullscreenElement()===this._resolvedTarget;this._setActive(e)}_setActive(e){this._active!==e&&(this._active=e,this._target.dispatchEvent(new CustomEvent("wcs-fullscreen:change",{detail:{active:e},bubbles:!0})))}_setError(e,t){this._error!==e&&(this._error=e,this._commitErrorInfo(null===e?null:i(e,t)),this._target.dispatchEvent(new CustomEvent("wcs-fullscreen:error",{detail:e,bubbles:!0})))}_commitErrorInfo(e){this._errorInfo=e,this._target.dispatchEvent(new CustomEvent("wcs-fullscreen:error-info-changed",{detail:e,bubbles:!0}))}}function c(e,t){let r=Object.getPrototypeOf(e);for(;null!==r;){const e=Object.getOwnPropertyDescriptor(r,t);if(void 0!==e)return"function"==typeof e.get||"function"==typeof e.set;r=Object.getPrototypeOf(r)}return!1}const a=new WeakMap;function o(e,t,r){const s=function(e,t){let r=a.get(e);return void 0===r&&(r=new Map,a.set(e,r)),r.has(t)||r.set(t,e.getAttribute(t)),r.get(t)}(e,t);!function(e,t,r){null===r?e.removeAttribute(t):e.setAttribute(t,r)}(e,t,void 0===r?s:null===r?null:String(r))}class u extends HTMLElement{static hasConnectedCallbackPromise=!0;static observedAttributes=["target"];static wcBindable={...l.wcBindable,inputs:[{name:"target",attribute:"target"}],commands:l.wcBindable.commands};_core;_connectedCallbackPromise=Promise.resolve();_internals=null;constructor(){super(),this._core=new l(this),this._internals=this._initInternals(),this._wireStates({"wcs-fullscreen:change":e=>({active:!0===e?.active})})}get debugStates(){return this._internals?[...this._internals.states]:[]}_initInternals(){try{if("function"!=typeof this.attachInternals)return null;const e=this.attachInternals();return e.states.add("wcs-probe"),e.states.delete("wcs-probe"),e}catch{return null}}_wireStates(e){if(null===this._internals)return;const t=this._internals.states;for(const[r,s]of Object.entries(e))this.addEventListener(r,e=>{const r=this.hasAttribute("debug-states");for(const[n,i]of Object.entries(s(e.detail))){try{i?t.add(n):t.delete(n)}catch{}r&&this.toggleAttribute(`data-wcs-state-${n}`,i)}})}get connectedCallbackPromise(){return this._connectedCallbackPromise}get target(){return this.getAttribute("target")??""}set target(e){o(this,"target",e)}get active(){return this._core.active}get error(){return this._core.error}get errorInfo(){return this._core.errorInfo}async requestFullscreen(){const{element:e}=this._resolveTarget();await this._core.requestFullscreen(e)}async exitFullscreen(){await this._core.exitFullscreen()}_resolveTarget(){const e=this.target;if("self"===e)return{element:this,display:"block"};if(""!==e){const t=this.getRootNode();return{element:this._safeQuery(t,e),display:"none"}}const t=this.firstElementChild;return t?{element:t,display:"contents"}:{element:this,display:"block"}}_safeQuery(e,t){try{return e.querySelector(t)}catch{return null}}_reresolve(){const{element:e,display:t}=this._resolveTarget();this.style.display=t,this._core.setTarget(e)}connectedCallback(){!function(e){const t=e.constructor?.wcBindable,r=t?.inputs;if(void 0!==r)for(const t of r){const r=t.name;if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!c(e,r))continue;const s=e,n=s[r];delete s[r],s[r]=n}}(this),this._reresolve(),this._connectedCallbackPromise=this._core.observe()}disconnectedCallback(){this._core.dispose()}attributeChangedCallback(e,t,r){t!==r&&this.isConnected&&this._reresolve()}}var h;!function(t=customElements){t.get(e.tagNames.fullscreen)||t.define(e.tagNames.fullscreen,u)}(h);
|
|
2
2
|
//# sourceMappingURL=auto.min.js.map
|
package/dist/auto.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto.min.js","sources":["../src/config.ts","../src/core/fullscreenCapabilities.ts","../src/core/FullscreenCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Fullscreen.ts","../src/bootstrapFullscreen.ts","../src/registerComponents.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n fullscreen: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n fullscreen: \"wcs-fullscreen\",\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\n/** A misspelt option would otherwise do nothing: `bootstrapFullscreen` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/fullscreen] bootstrapFullscreen: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","/**\n * fullscreenCapabilities.ts\n *\n * Fullscreen node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。fullscreen は referenced element を操作するモニタ的ノードで競合 operation\n * を持たないため lane は無く、error taxonomy(errorInfo)のみを採用する。\n *\n * `_setError` は合成 `{ message }`(target 未解決 / API 非対応)と caught 例外\n * (`NotAllowedError` / `TypeError` = user gesture 外の requestFullscreen 拒否)を混在\n * 受理する。呼出側が明示 `code` を渡して合成側を曖昧さ無く分類し、caught は `.name` で\n * 分類する(storage / screen-orientation と同じ discriminator 方式)。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 明示 code discriminator(合成エラーの呼出側が渡す)。 */\nexport type FullscreenErrorKind = \"capability-missing\" | \"invalid-argument\";\n\n/** 安定した fullscreen error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_FULLSCREEN_ERROR_CODE = {\n /** Fullscreen API 非対応。 */\n CapabilityMissing: \"capability-missing\",\n /** target selector が要素に解決しない等の入力不備。 */\n InvalidArgument: \"invalid-argument\",\n /** `NotAllowedError` / `TypeError` — user gesture 外での要求拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の caught 例外。 */\n FullscreenError: \"fullscreen-error\",\n} as const;\n\nfunction messageOf(error: unknown): string {\n return typeof (error as { message?: unknown } | null)?.message === \"string\"\n ? (error as { message: string }).message\n : String(error);\n}\n\n/**\n * fullscreen の失敗を serializable な error taxonomy に写す。`kind` は合成エラーの\n * 呼出側が渡す明示 discriminator(`capability-missing` / `invalid-argument`)。未指定は\n * caught 例外を意味し、`.name` で分類する。`NotAllowedError` / `TypeError` は user\n * gesture 内で再試行すれば成功しうるため recoverable=true。\n */\nexport function deriveFullscreenErrorInfo(error: unknown, kind?: FullscreenErrorKind): WcsIoErrorInfo {\n const message = messageOf(error);\n if (kind === \"capability-missing\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (kind === \"invalid-argument\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.InvalidArgument, phase: \"start\", recoverable: false, message };\n }\n const name = (error as { name?: unknown } | null)?.name;\n if (name === \"NotAllowedError\" || name === \"TypeError\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.NotAllowed, phase: \"execute\", recoverable: true, message };\n }\n return { code: WCS_FULLSCREEN_ERROR_CODE.FullscreenError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveFullscreenErrorInfo, FullscreenErrorKind } from \"./fullscreenCapabilities.js\";\n\n/**\n * Headless Fullscreen API primitive. Unlike most wcstack IO nodes, this Core\n * does not operate on itself: it drives `requestFullscreen()` /\n * `exitFullscreen()` on a *referenced* Element that the Shell resolves via its\n * `target` attribute (docs/fullscreen-tag-design.md §0). The Core only ever\n * receives already-resolved `Element`s from its callers — it has no opinion on\n * how `target` selectors are parsed.\n *\n * `document.fullscreenElement` is a single document-wide value, so this Core\n * always compares against the *last element it resolved* (via\n * `requestFullscreen()`/`setTarget()`), never against \"is the document\n * fullscreen at all\" — that comparison is what keeps multiple concurrent\n * `<wcs-fullscreen>` instances from all reporting the same `active` value\n * (docs/fullscreen-tag-design.md §2.1, MUST).\n */\nexport class FullscreenCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"active\", event: \"wcs-fullscreen:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.active },\n // `error` / `errorInfo` are observable failure outputs. Historically `error`\n // was an imperative getter with no event; both are now bindable (event-backed)\n // so `data-wcs` / bind() can observe a request/exit failure. `errorInfo` is the\n // additive serializable taxonomy (stable code / phase / recoverable) derived\n // from `error`; the `error` value shape is unchanged. No lane — fullscreen\n // drives a referenced element, not a competing operation.\n { name: \"error\", event: \"wcs-fullscreen:error\", semantics: \"state\" },\n { name: \"errorInfo\", event: \"wcs-fullscreen:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestFullscreen\", async: true },\n { name: \"exitFullscreen\", async: true },\n ],\n };\n\n private _target: EventTarget;\n private _active: boolean = false;\n // Single error slot (§8): null means \"no recent failure\". Fullscreen's\n // gesture-rejection failure is a one-shot event, not a persistent state\n // machine like permission's 4-value surface — active/error are two\n // orthogonal, independently-observable axes.\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n\n // The last Element this Core resolved via requestFullscreen()/setTarget().\n // Compared against document.fullscreenElement on every fullscreenchange so\n // each instance judges only its own target (§2.1). null means \"no target\n // resolved yet\" — active must stay false in that case.\n private _resolvedTarget: Element | null = null;\n\n // Generation guard (§6): Core-scoped (one per Core, not per-target),\n // mirroring fetch/upload. document.fullscreenElement is a single\n // document-wide slot, so at most one in-flight request/exit is meaningful\n // per Core at a time.\n private _gen = 0;\n\n // True once observe() has attached the document-level fullscreenchange\n // listener. Guards observe() so a redundant call does not double-subscribe;\n // dispose() resets it so a later observe() resumes cleanly.\n private _subscribed = false;\n\n // SSR (§10): no asynchronous probe to await — observe() completes\n // synchronously, so readiness is 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 active(): boolean {\n return this._active;\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-fullscreen:error-info-changed`), derived from `error`; the existing\n * `error` value shape is unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Update the resolved target without issuing a fullscreen request (e.g. the\n * Shell re-resolves `target` on attribute change / connect). Re-evaluates\n * `active` against the current `document.fullscreenElement` so the state\n * stays correct even if the target changed while already fullscreen.\n */\n setTarget(element: Element | null): void {\n this._resolvedTarget = element;\n this._applyActive();\n }\n\n // Lifecycle (§10/§3.5). Idempotent: a second observe() while already\n // subscribed is a no-op (no double listener). Synchronous overall (no probe\n // to await), so the returned promise is only for API uniformity with other\n // IO nodes.\n observe(): Promise<void> {\n if (!this._subscribed) {\n this._subscribed = true;\n document.addEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n return this._ready;\n }\n\n dispose(): void {\n this._gen++;\n if (this._subscribed) {\n this._subscribed = false;\n document.removeEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n }\n\n /**\n * Request fullscreen on `element`. never-throw (§3/§6): a missing API or a\n * rejected promise (e.g. a `TypeError` from a call outside a user\n * gesture, per the WHATWG Fullscreen spec's transient-activation check) is\n * caught and surfaced via `error`, never thrown. The caller\n * (Shell) is responsible for resolving `target` and for ensuring this is\n * invoked from within an actual user gesture — this Core cannot manufacture\n * one (docs/fullscreen-tag-design.md §3).\n */\n async requestFullscreen(element: Element | null): Promise<void> {\n const gen = ++this._gen;\n this._resolvedTarget = element;\n if (!element) {\n // Distinct from \"API is not supported\" (below): the Shell's `target`\n // selector did not resolve to any element (missing/typo'd selector).\n // Conflating the two previously misled users into thinking Fullscreen\n // itself was unsupported when only their selector was wrong.\n this._setError({ message: \"Fullscreen target could not be resolved.\" }, \"invalid-argument\");\n return;\n }\n const fn = this._requestFullscreenFn(element);\n if (!fn) {\n this._setError({ message: \"Fullscreen API is not supported.\" }, \"capability-missing\");\n return;\n }\n try {\n await fn.call(element);\n if (gen !== this._gen) return; // stale: dispose()/superseding call ran\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n /**\n * Exit fullscreen. Silent no-op (§7) when nothing is currently fullscreen or\n * the API is unsupported — both are treated as \"already achieved the exit\n * intent\", not as errors, keeping repeated calls safe and never-throw.\n */\n async exitFullscreen(): Promise<void> {\n // no-op checks come BEFORE the generation bump: a call that does nothing\n // must not supersede an in-flight requestFullscreen() — bumping first\n // would make the pending request's settle handling stale and silently\n // swallow its error/active updates.\n if (this._fullscreenElement() === null) return; // already not fullscreen: silent no-op\n const fn = this._exitFullscreenFn();\n if (!fn) return; // unsupported: silent no-op (semantically already \"not fullscreen\")\n const gen = ++this._gen;\n try {\n await fn();\n if (gen !== this._gen) return; // stale\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n // --- API resolution layer (§4): call-time, never cached. Lets tests\n // install/remove the standard/legacy APIs freely and lets an unsupported\n // environment be detected correctly on every call. ---\n\n private _requestFullscreenFn(el: Element): (() => Promise<void>) | undefined {\n return this._elementFullscreenFn(el, \"requestFullscreen\")\n ?? this._elementFullscreenFn(el, \"webkitRequestFullscreen\");\n }\n\n // Resolve a fullscreen method for `el` WITHOUT a naive `el[name]` lookup.\n // A plain lookup walks the whole prototype chain — and <wcs-fullscreen>\n // itself declares a `requestFullscreen()` *command* method, so when the\n // resolved target is the Shell element (target=\"self\", or target omitted\n // with no children), the naive lookup would find the Shell's own command\n // instead of the platform API and recurse infinitely (stack overflow).\n // Instead: check the element's own properties (how tests install stubs —\n // happy-dom has no Fullscreen API — and how a deliberate per-element\n // monkey-patch would appear), then jump straight to Element.prototype,\n // where the platform defines the real methods. Both the standard and the\n // legacy webkit name go through this same resolution for symmetry.\n private _elementFullscreenFn(el: Element, name: string): (() => Promise<void>) | undefined {\n if (Object.prototype.hasOwnProperty.call(el, name)) {\n return (el as any)[name];\n }\n return (Element.prototype as any)[name];\n }\n\n private _exitFullscreenFn(): (() => Promise<void>) | undefined {\n const d = document as any;\n return d.exitFullscreen?.bind(document) ?? d.webkitExitFullscreen?.bind(document);\n }\n\n private _fullscreenElement(): Element | null {\n const d = document as any;\n return d.fullscreenElement ?? d.webkitFullscreenElement ?? null;\n }\n\n private _fullscreenChangeEventName(): string {\n return \"onfullscreenchange\" in document ? \"fullscreenchange\" : \"webkitfullscreenchange\";\n }\n\n // --- Internal ---\n\n private _onFullscreenChange = (): void => {\n this._applyActive();\n };\n\n // Re-derive `active` by comparing document.fullscreenElement (incl. legacy\n // fallback) against *this instance's* resolved target (§2/§2.1/§5). A null\n // resolved target always yields active=false — there is nothing for this\n // instance to claim as \"mine\".\n private _applyActive(): void {\n const next = this._resolvedTarget !== null && this._fullscreenElement() === this._resolvedTarget;\n this._setActive(next);\n }\n\n private _setActive(v: boolean): void {\n if (this._active === v) return; // same-value guard (§3.3 MUST)\n this._active = v;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:change\", {\n detail: { active: v },\n bubbles: true,\n }));\n }\n\n // `kind` is an explicit taxonomy discriminator passed only from the synthetic\n // error sites (unsupported / unresolved target); caught exceptions pass no kind\n // and are classified by their `.name`. Both `error` and the additive `errorInfo`\n // are now event-backed so a request/exit failure is observable via bind().\n private _setError(error: any, kind?: FullscreenErrorKind): void {\n // Same-value guard on reference: each failure builds a fresh object and the\n // clear path passes the literal null, so this only suppresses redundant\n // null→null (a successful request/exit clearing an already-null error).\n if (this._error === error) return;\n this._error = error;\n // Keep the additive errorInfo taxonomy in sync; fire it before the `error`\n // event so an observer of both sees the classification first (io-node family).\n this._commitErrorInfo(error === null ? null : deriveFullscreenErrorInfo(error, kind));\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (already reference-guarded), so errorInfo\n // transitions exactly when error does — no separate guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error-info-changed\", {\n detail: info,\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 } from \"../types.js\";\nimport { FullscreenCore } from \"../core/FullscreenCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-fullscreen target=\"...\">` — declarative Fullscreen API control.\n *\n * Like `intersection`/`resize`, this Shell operates on a *referenced* element,\n * not itself (docs/fullscreen-tag-design.md §0): `target` resolves which\n * element `requestFullscreen()`/`exitFullscreen()` are invoked on, using the\n * exact same 3-mode resolution as `<wcs-intersect>`\n * (docs/fullscreen-tag-design.md §1):\n *\n * | `target` | operates on | display | use case |\n * |-----------------|-------------------------|-------------|--------------------------|\n * | omitted | first element child | `contents` | wrap a gallery image/video |\n * | `\"#hero\"` / sel | the matched element | `none` | point at a distant node |\n * | `\"self\"` | the element itself | `block` | fullscreen the wrapper |\n *\n * `requestFullscreen()` requires an active user gesture — this element cannot\n * manufacture one. Invoke the command from within a real click handler\n * (typically via the command-token protocol: this element subscribes with\n * `command.requestFullscreen: $command.<token>`, and a button emits the\n * token from its own click handler, e.g. `onclick: $command.<token>`).\n */\nexport class WcsFullscreen extends HTMLElement {\n // SSR (§10): the fullscreenchange subscription is established synchronously\n // on connect, but the Shell still exposes connectedCallbackPromise so the\n // state binder can await it uniformly across all IO nodes before\n // snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static observedAttributes = [\"target\"];\n\n static wcBindable: IWcBindable = {\n ...FullscreenCore.wcBindable,\n inputs: [{ name: \"target\", attribute: \"target\" }],\n // Core の commands をそのまま継承(単一情報源)。network/intersection と同型。\n commands: FullscreenCore.wcBindable.commands,\n };\n\n private _core: FullscreenCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new FullscreenCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-fullscreen:change\": (d) => ({ active: d?.active === true }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Attribute accessors ---\n\n get target(): string {\n return this.getAttribute(\"target\") ?? \"\";\n }\n\n set target(value: string) {\n this.setAttribute(\"target\", value);\n }\n\n // --- Core delegated getters ---\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n // --- Commands ---\n\n /**\n * Resolve `target` and request fullscreen on it. never-throw: an\n * unresolvable target or an unsupported/rejected API call are both\n * surfaced via `error`, never thrown (docs/fullscreen-tag-design.md §3/§6).\n */\n async requestFullscreen(): Promise<void> {\n const { element } = this._resolveTarget();\n await this._core.requestFullscreen(element);\n }\n\n async exitFullscreen(): Promise<void> {\n await this._core.exitFullscreen();\n }\n\n // --- Internal ---\n\n // Copied verbatim from <wcs-intersect> (Intersect.ts _resolveTarget/_safeQuery,\n // docs/fullscreen-tag-design.md §1): identical 3-mode resolution, only the\n // \"what to do with the resolved element\" step differs.\n private _resolveTarget(): { element: Element | null; display: string } {\n const target = this.target;\n if (target === \"self\") {\n return { element: this, display: \"block\" };\n }\n if (target !== \"\") {\n const scope = this.getRootNode() as Document | ShadowRoot;\n return { element: this._safeQuery(scope, target), display: \"none\" };\n }\n const child = this.firstElementChild;\n if (child) {\n return { element: child, display: \"contents\" };\n }\n return { element: this, display: \"block\" };\n }\n\n private _safeQuery(scope: Document | ShadowRoot, selector: string): Element | null {\n try {\n return scope.querySelector(selector);\n } catch {\n return null;\n }\n }\n\n private _reresolve(): void {\n const { element, display } = this._resolveTarget();\n this.style.display = display;\n this._core.setTarget(element);\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this._reresolve();\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return;\n if (!this.isConnected) return;\n this._reresolve();\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapFullscreen(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n","import { WcsFullscreen } from \"./components/Fullscreen.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.fullscreen)) {\n registry.define(config.tagNames.fullscreen, WcsFullscreen);\n }\n}\n"],"names":["config","tagNames","fullscreen","WCS_FULLSCREEN_ERROR_CODE","deriveFullscreenErrorInfo","error","kind","message","String","messageOf","code","phase","recoverable","name","FullscreenCore","EventTarget","static","protocol","version","properties","event","semantics","getter","e","detail","active","commands","async","_target","_active","_error","_errorInfo","_resolvedTarget","_gen","_subscribed","_ready","Promise","resolve","constructor","target","super","this","ready","errorInfo","setTarget","element","_applyActive","observe","document","addEventListener","_fullscreenChangeEventName","_onFullscreenChange","dispose","removeEventListener","requestFullscreen","gen","_setError","fn","_requestFullscreenFn","call","exitFullscreen","_fullscreenElement","_exitFullscreenFn","el","_elementFullscreenFn","Object","prototype","hasOwnProperty","Element","d","bind","webkitExitFullscreen","fullscreenElement","webkitFullscreenElement","next","_setActive","v","dispatchEvent","CustomEvent","bubbles","_commitErrorInfo","info","hasAccessorOnPrototype","proto","getPrototypeOf","descriptor","getOwnPropertyDescriptor","undefined","get","set","WcsFullscreen","HTMLElement","wcBindable","inputs","attribute","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","debugStates","states","attachInternals","internals","add","delete","map","toStates","entries","debug","hasAttribute","on","toggleAttribute","connectedCallbackPromise","getAttribute","value","setAttribute","_resolveTarget","display","scope","getRootNode","_safeQuery","child","firstElementChild","selector","querySelector","_reresolve","style","connectedCallback","declaration","input","record","upgradeProperties","disconnectedCallback","attributeChangedCallback","_name","oldValue","newValue","isConnected","registry","customElements","define","registerComponents"],"mappings":"AAQA,MA0BaA,EA1BoB,CAC/BC,SAAU,CACRC,WAAY,mBCUHC,EAEQ,qBAFRA,EAIM,mBAJNA,EAMC,cANDA,EAQM,mBAeb,SAAUC,EAA0BC,EAAgBC,GACxD,MAAMC,EAbR,SAAmBF,GACjB,MAAmE,iBAApDA,GAAw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vD,KAAKsD,MAAMhD,SAC9C,CAEA,oBAAAsF,GACE5F,KAAKsD,MAAM3C,SACb,CAEA,wBAAAkF,CAAyBC,EAAeC,EAAyBC,GAC3DD,IAAaC,GACZhG,KAAKiG,aACVjG,KAAKqF,YACP,EC5LI,IAA4Da,GCI5D,SAA6BA,EAAkCC,gBAC9DD,EAASnD,IAAIxF,EAAOC,SAASC,aAChCyI,EAASE,OAAO7I,EAAOC,SAASC,WAAYwF,EAEhD,CDJEoD,CAAmBH"}
|
|
1
|
+
{"version":3,"file":"auto.min.js","sources":["../src/config.ts","../src/core/fullscreenCapabilities.ts","../src/core/FullscreenCore.ts","../src/protocol/upgradeProperties.ts","../src/protocol/inputAttribute.ts","../src/components/Fullscreen.ts","../src/bootstrapFullscreen.ts","../src/registerComponents.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n fullscreen: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n fullscreen: \"wcs-fullscreen\",\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\n/** A misspelt option would otherwise do nothing: `bootstrapFullscreen` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/fullscreen] bootstrapFullscreen: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","/**\n * fullscreenCapabilities.ts\n *\n * Fullscreen node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。fullscreen は referenced element を操作するモニタ的ノードで競合 operation\n * を持たないため lane は無く、error taxonomy(errorInfo)のみを採用する。\n *\n * `_setError` は合成 `{ message }`(target 未解決 / API 非対応)と caught 例外\n * (`NotAllowedError` / `TypeError` = user gesture 外の requestFullscreen 拒否)を混在\n * 受理する。呼出側が明示 `code` を渡して合成側を曖昧さ無く分類し、caught は `.name` で\n * 分類する(storage / screen-orientation と同じ discriminator 方式)。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 明示 code discriminator(合成エラーの呼出側が渡す)。 */\nexport type FullscreenErrorKind = \"capability-missing\" | \"invalid-argument\";\n\n/** 安定した fullscreen error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_FULLSCREEN_ERROR_CODE = {\n /** Fullscreen API 非対応。 */\n CapabilityMissing: \"capability-missing\",\n /** target selector が要素に解決しない等の入力不備。 */\n InvalidArgument: \"invalid-argument\",\n /** `NotAllowedError` / `TypeError` — user gesture 外での要求拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の caught 例外。 */\n FullscreenError: \"fullscreen-error\",\n} as const;\n\nfunction messageOf(error: unknown): string {\n return typeof (error as { message?: unknown } | null)?.message === \"string\"\n ? (error as { message: string }).message\n : String(error);\n}\n\n/**\n * fullscreen の失敗を serializable な error taxonomy に写す。`kind` は合成エラーの\n * 呼出側が渡す明示 discriminator(`capability-missing` / `invalid-argument`)。未指定は\n * caught 例外を意味し、`.name` で分類する。`NotAllowedError` / `TypeError` は user\n * gesture 内で再試行すれば成功しうるため recoverable=true。\n */\nexport function deriveFullscreenErrorInfo(error: unknown, kind?: FullscreenErrorKind): WcsIoErrorInfo {\n const message = messageOf(error);\n if (kind === \"capability-missing\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (kind === \"invalid-argument\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.InvalidArgument, phase: \"start\", recoverable: false, message };\n }\n const name = (error as { name?: unknown } | null)?.name;\n if (name === \"NotAllowedError\" || name === \"TypeError\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.NotAllowed, phase: \"execute\", recoverable: true, message };\n }\n return { code: WCS_FULLSCREEN_ERROR_CODE.FullscreenError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveFullscreenErrorInfo, FullscreenErrorKind } from \"./fullscreenCapabilities.js\";\n\n/**\n * Headless Fullscreen API primitive. Unlike most wcstack IO nodes, this Core\n * does not operate on itself: it drives `requestFullscreen()` /\n * `exitFullscreen()` on a *referenced* Element that the Shell resolves via its\n * `target` attribute (docs/fullscreen-tag-design.md §0). The Core only ever\n * receives already-resolved `Element`s from its callers — it has no opinion on\n * how `target` selectors are parsed.\n *\n * `document.fullscreenElement` is a single document-wide value, so this Core\n * always compares against the *last element it resolved* (via\n * `requestFullscreen()`/`setTarget()`), never against \"is the document\n * fullscreen at all\" — that comparison is what keeps multiple concurrent\n * `<wcs-fullscreen>` instances from all reporting the same `active` value\n * (docs/fullscreen-tag-design.md §2.1, MUST).\n */\nexport class FullscreenCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"active\", event: \"wcs-fullscreen:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.active },\n // `error` / `errorInfo` are observable failure outputs. Historically `error`\n // was an imperative getter with no event; both are now bindable (event-backed)\n // so `data-wcs` / bind() can observe a request/exit failure. `errorInfo` is the\n // additive serializable taxonomy (stable code / phase / recoverable) derived\n // from `error`; the `error` value shape is unchanged. No lane — fullscreen\n // drives a referenced element, not a competing operation.\n { name: \"error\", event: \"wcs-fullscreen:error\", semantics: \"state\" },\n { name: \"errorInfo\", event: \"wcs-fullscreen:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestFullscreen\", async: true },\n { name: \"exitFullscreen\", async: true },\n ],\n };\n\n private _target: EventTarget;\n private _active: boolean = false;\n // Single error slot (§8): null means \"no recent failure\". Fullscreen's\n // gesture-rejection failure is a one-shot event, not a persistent state\n // machine like permission's 4-value surface — active/error are two\n // orthogonal, independently-observable axes.\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n\n // The last Element this Core resolved via requestFullscreen()/setTarget().\n // Compared against document.fullscreenElement on every fullscreenchange so\n // each instance judges only its own target (§2.1). null means \"no target\n // resolved yet\" — active must stay false in that case.\n private _resolvedTarget: Element | null = null;\n\n // Generation guard (§6): Core-scoped (one per Core, not per-target),\n // mirroring fetch/upload. document.fullscreenElement is a single\n // document-wide slot, so at most one in-flight request/exit is meaningful\n // per Core at a time.\n private _gen = 0;\n\n // True once observe() has attached the document-level fullscreenchange\n // listener. Guards observe() so a redundant call does not double-subscribe;\n // dispose() resets it so a later observe() resumes cleanly.\n private _subscribed = false;\n\n // SSR (§10): no asynchronous probe to await — observe() completes\n // synchronously, so readiness is 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 active(): boolean {\n return this._active;\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-fullscreen:error-info-changed`), derived from `error`; the existing\n * `error` value shape is unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Update the resolved target without issuing a fullscreen request (e.g. the\n * Shell re-resolves `target` on attribute change / connect). Re-evaluates\n * `active` against the current `document.fullscreenElement` so the state\n * stays correct even if the target changed while already fullscreen.\n */\n setTarget(element: Element | null): void {\n this._resolvedTarget = element;\n this._applyActive();\n }\n\n // Lifecycle (§10/§3.5). Idempotent: a second observe() while already\n // subscribed is a no-op (no double listener). Synchronous overall (no probe\n // to await), so the returned promise is only for API uniformity with other\n // IO nodes.\n observe(): Promise<void> {\n if (!this._subscribed) {\n this._subscribed = true;\n document.addEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n return this._ready;\n }\n\n dispose(): void {\n this._gen++;\n if (this._subscribed) {\n this._subscribed = false;\n document.removeEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n }\n\n /**\n * Request fullscreen on `element`. never-throw (§3/§6): a missing API or a\n * rejected promise (e.g. a `TypeError` from a call outside a user\n * gesture, per the WHATWG Fullscreen spec's transient-activation check) is\n * caught and surfaced via `error`, never thrown. The caller\n * (Shell) is responsible for resolving `target` and for ensuring this is\n * invoked from within an actual user gesture — this Core cannot manufacture\n * one (docs/fullscreen-tag-design.md §3).\n */\n async requestFullscreen(element: Element | null): Promise<void> {\n const gen = ++this._gen;\n this._resolvedTarget = element;\n if (!element) {\n // Distinct from \"API is not supported\" (below): the Shell's `target`\n // selector did not resolve to any element (missing/typo'd selector).\n // Conflating the two previously misled users into thinking Fullscreen\n // itself was unsupported when only their selector was wrong.\n this._setError({ message: \"Fullscreen target could not be resolved.\" }, \"invalid-argument\");\n return;\n }\n const fn = this._requestFullscreenFn(element);\n if (!fn) {\n this._setError({ message: \"Fullscreen API is not supported.\" }, \"capability-missing\");\n return;\n }\n try {\n await fn.call(element);\n if (gen !== this._gen) return; // stale: dispose()/superseding call ran\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n /**\n * Exit fullscreen. Silent no-op (§7) when nothing is currently fullscreen or\n * the API is unsupported — both are treated as \"already achieved the exit\n * intent\", not as errors, keeping repeated calls safe and never-throw.\n */\n async exitFullscreen(): Promise<void> {\n // no-op checks come BEFORE the generation bump: a call that does nothing\n // must not supersede an in-flight requestFullscreen() — bumping first\n // would make the pending request's settle handling stale and silently\n // swallow its error/active updates.\n if (this._fullscreenElement() === null) return; // already not fullscreen: silent no-op\n const fn = this._exitFullscreenFn();\n if (!fn) return; // unsupported: silent no-op (semantically already \"not fullscreen\")\n const gen = ++this._gen;\n try {\n await fn();\n if (gen !== this._gen) return; // stale\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n // --- API resolution layer (§4): call-time, never cached. Lets tests\n // install/remove the standard/legacy APIs freely and lets an unsupported\n // environment be detected correctly on every call. ---\n\n private _requestFullscreenFn(el: Element): (() => Promise<void>) | undefined {\n return this._elementFullscreenFn(el, \"requestFullscreen\")\n ?? this._elementFullscreenFn(el, \"webkitRequestFullscreen\");\n }\n\n // Resolve a fullscreen method for `el` WITHOUT a naive `el[name]` lookup.\n // A plain lookup walks the whole prototype chain — and <wcs-fullscreen>\n // itself declares a `requestFullscreen()` *command* method, so when the\n // resolved target is the Shell element (target=\"self\", or target omitted\n // with no children), the naive lookup would find the Shell's own command\n // instead of the platform API and recurse infinitely (stack overflow).\n // Instead: check the element's own properties (how tests install stubs —\n // happy-dom has no Fullscreen API — and how a deliberate per-element\n // monkey-patch would appear), then jump straight to Element.prototype,\n // where the platform defines the real methods. Both the standard and the\n // legacy webkit name go through this same resolution for symmetry.\n private _elementFullscreenFn(el: Element, name: string): (() => Promise<void>) | undefined {\n if (Object.prototype.hasOwnProperty.call(el, name)) {\n return (el as any)[name];\n }\n return (Element.prototype as any)[name];\n }\n\n private _exitFullscreenFn(): (() => Promise<void>) | undefined {\n const d = document as any;\n return d.exitFullscreen?.bind(document) ?? d.webkitExitFullscreen?.bind(document);\n }\n\n private _fullscreenElement(): Element | null {\n const d = document as any;\n return d.fullscreenElement ?? d.webkitFullscreenElement ?? null;\n }\n\n private _fullscreenChangeEventName(): string {\n return \"onfullscreenchange\" in document ? \"fullscreenchange\" : \"webkitfullscreenchange\";\n }\n\n // --- Internal ---\n\n private _onFullscreenChange = (): void => {\n this._applyActive();\n };\n\n // Re-derive `active` by comparing document.fullscreenElement (incl. legacy\n // fallback) against *this instance's* resolved target (§2/§2.1/§5). A null\n // resolved target always yields active=false — there is nothing for this\n // instance to claim as \"mine\".\n private _applyActive(): void {\n const next = this._resolvedTarget !== null && this._fullscreenElement() === this._resolvedTarget;\n this._setActive(next);\n }\n\n private _setActive(v: boolean): void {\n if (this._active === v) return; // same-value guard (§3.3 MUST)\n this._active = v;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:change\", {\n detail: { active: v },\n bubbles: true,\n }));\n }\n\n // `kind` is an explicit taxonomy discriminator passed only from the synthetic\n // error sites (unsupported / unresolved target); caught exceptions pass no kind\n // and are classified by their `.name`. Both `error` and the additive `errorInfo`\n // are now event-backed so a request/exit failure is observable via bind().\n private _setError(error: any, kind?: FullscreenErrorKind): void {\n // Same-value guard on reference: each failure builds a fresh object and the\n // clear path passes the literal null, so this only suppresses redundant\n // null→null (a successful request/exit clearing an already-null error).\n if (this._error === error) return;\n this._error = error;\n // Keep the additive errorInfo taxonomy in sync; fire it before the `error`\n // event so an observer of both sees the classification first (io-node family).\n this._commitErrorInfo(error === null ? null : deriveFullscreenErrorInfo(error, kind));\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (already reference-guarded), so errorInfo\n // transitions exactly when error does — no separate guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error-info-changed\", {\n detail: info,\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","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/input-attribute.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// 属性へ反映する wc-bindable 入力の producer 側(SPEC-extensions § Producer guidance for inputs の P1〜P3)。\n// 入力の setter は属性をこの 2 関数で書く。それで次が揃う:\n// - `undefined` は「値が無い」(P1): 属性を、この関数で最初に書く前の状態 — マークアップに書かれた値、\n// 無ければ属性なし(= その入力の文書化した既定値)— へ戻す。applier プロファイルを宣言する binder は\n// 値の後の `undefined` を書き(A2)、React 19 も書き、直接の代入でも届く。\n// - `null` はクリア(P2): 属性なし、つまり文書化した既定値。\n// - どちらも文字列 \"undefined\" / \"null\" として属性に入らない。\n//\n// 「最初に書く前」は、その最初の書き込みのときに読む(遅延)。upgrade 前に代入されたプロパティは\n// connectedCallback の upgradeProperties() が通し直すので、そのときにはパーサが書いた属性が揃っている。\n// 要素自身が setter を通さずに書いた属性は、最初の書き込みより前なら「最初の状態」に含まれる。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/input-attribute.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/inputAttribute.ts). Those copies are generated — do not edit them.\n\nconst initialAttributes = new WeakMap<Element, Map<string, string | null>>();\n\n/** The attribute as it stood before the first write through these helpers. */\nfunction initialAttribute(el: Element, name: string): string | null {\n let byName = initialAttributes.get(el);\n if (byName === undefined) {\n byName = new Map();\n initialAttributes.set(el, byName);\n }\n if (!byName.has(name)) byName.set(name, el.getAttribute(name));\n return byName.get(name) as string | null;\n}\n\nfunction writeAttribute(el: Element, name: string, value: string | null): void {\n if (value === null) el.removeAttribute(name);\n else el.setAttribute(name, value);\n}\n\n/**\n * A value attribute. `value` is written as `String(value)`; `null` removes the attribute;\n * `undefined` restores the attribute the element started with.\n */\nexport function reflectAttribute(el: Element, name: string, value: unknown): void {\n const initial = initialAttribute(el, name);\n writeAttribute(el, name, value === undefined ? initial : value === null ? null : String(value));\n}\n\n/**\n * A boolean attribute, present while `value` is truthy (`null` and `false` remove it);\n * `undefined` restores the attribute the element started with.\n */\nexport function reflectBooleanAttribute(el: Element, name: string, value: unknown): void {\n const initial = initialAttribute(el, name);\n writeAttribute(el, name, value === undefined ? initial : value ? \"\" : null);\n}\n","import { IWcBindable } from \"../types.js\";\nimport { FullscreenCore } from \"../core/FullscreenCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\nimport { reflectAttribute } from \"../protocol/inputAttribute.js\";\n\n/**\n * `<wcs-fullscreen target=\"...\">` — declarative Fullscreen API control.\n *\n * Like `intersection`/`resize`, this Shell operates on a *referenced* element,\n * not itself (docs/fullscreen-tag-design.md §0): `target` resolves which\n * element `requestFullscreen()`/`exitFullscreen()` are invoked on, using the\n * exact same 3-mode resolution as `<wcs-intersect>`\n * (docs/fullscreen-tag-design.md §1):\n *\n * | `target` | operates on | display | use case |\n * |-----------------|-------------------------|-------------|--------------------------|\n * | omitted | first element child | `contents` | wrap a gallery image/video |\n * | `\"#hero\"` / sel | the matched element | `none` | point at a distant node |\n * | `\"self\"` | the element itself | `block` | fullscreen the wrapper |\n *\n * `requestFullscreen()` requires an active user gesture — this element cannot\n * manufacture one. Invoke the command from within a real click handler\n * (typically via the command-token protocol: this element subscribes with\n * `command.requestFullscreen: $command.<token>`, and a button emits the\n * token from its own click handler, e.g. `onclick: $command.<token>`).\n */\nexport class WcsFullscreen extends HTMLElement {\n // SSR (§10): the fullscreenchange subscription is established synchronously\n // on connect, but the Shell still exposes connectedCallbackPromise so the\n // state binder can await it uniformly across all IO nodes before\n // snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static observedAttributes = [\"target\"];\n\n static wcBindable: IWcBindable = {\n ...FullscreenCore.wcBindable,\n inputs: [{ name: \"target\", attribute: \"target\" }],\n // Core の commands をそのまま継承(単一情報源)。network/intersection と同型。\n commands: FullscreenCore.wcBindable.commands,\n };\n\n private _core: FullscreenCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new FullscreenCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-fullscreen:change\": (d) => ({ active: d?.active === true }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Attribute accessors ---\n\n get target(): string {\n return this.getAttribute(\"target\") ?? \"\";\n }\n\n // Never lets setAttribute stringify null / undefined (an \"undefined\" selector\n // resolves nothing): `null` removes the attribute (the first-child default),\n // `undefined` restores the attribute the element started with (wc-bindable\n // producer guidance P1; React 19 and a direct assignment deliver it,\n // @wcstack/state does not).\n set target(value: string | null | undefined) {\n reflectAttribute(this, \"target\", value);\n }\n\n // --- Core delegated getters ---\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n // --- Commands ---\n\n /**\n * Resolve `target` and request fullscreen on it. never-throw: an\n * unresolvable target or an unsupported/rejected API call are both\n * surfaced via `error`, never thrown (docs/fullscreen-tag-design.md §3/§6).\n */\n async requestFullscreen(): Promise<void> {\n const { element } = this._resolveTarget();\n await this._core.requestFullscreen(element);\n }\n\n async exitFullscreen(): Promise<void> {\n await this._core.exitFullscreen();\n }\n\n // --- Internal ---\n\n // Copied verbatim from <wcs-intersect> (Intersect.ts _resolveTarget/_safeQuery,\n // docs/fullscreen-tag-design.md §1): identical 3-mode resolution, only the\n // \"what to do with the resolved element\" step differs.\n private _resolveTarget(): { element: Element | null; display: string } {\n const target = this.target;\n if (target === \"self\") {\n return { element: this, display: \"block\" };\n }\n if (target !== \"\") {\n const scope = this.getRootNode() as Document | ShadowRoot;\n return { element: this._safeQuery(scope, target), display: \"none\" };\n }\n const child = this.firstElementChild;\n if (child) {\n return { element: child, display: \"contents\" };\n }\n return { element: this, display: \"block\" };\n }\n\n private _safeQuery(scope: Document | ShadowRoot, selector: string): Element | null {\n try {\n return scope.querySelector(selector);\n } catch {\n return null;\n }\n }\n\n private _reresolve(): void {\n const { element, display } = this._resolveTarget();\n this.style.display = display;\n this._core.setTarget(element);\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this._reresolve();\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return;\n if (!this.isConnected) return;\n this._reresolve();\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapFullscreen(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(registry);\n}\n","import { WcsFullscreen } from \"./components/Fullscreen.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.fullscreen)) {\n registry.define(config.tagNames.fullscreen, WcsFullscreen);\n }\n}\n"],"names":["config","tagNames","fullscreen","WCS_FULLSCREEN_ERROR_CODE","deriveFullscreenErrorInfo","error","kind","message","String","messageOf","code","phase","recoverable","name","FullscreenCore","EventTarget","static","protocol","version","properties","event","semantics","getter","e","detail","active","commands","async","_target","_active","_error","_errorInfo","_resolvedTarget","_gen","_subscribed","_ready","Promise","resolve","constructor","target","super","this","ready","errorInfo","setTarget","element","_applyActive","observe","document","addEventListener","_fullscreenChangeEventName","_onFullscreenChange","dispose","removeEventListener","requestFullscreen","gen","_setError","fn","_requestFullscreenFn","call","exitFullscreen","_fullscreenElement","_exitFullscreenFn","el","_elementFullscreenFn","Object","prototype","hasOwnProperty","Element","d","bind","webkitExitFullscreen","fullscreenElement","webkitFullscreenElement","next","_setActive","v","dispatchEvent","CustomEvent","bubbles","_commitErrorInfo","info","hasAccessorOnPrototype","proto","getPrototypeOf","descriptor","getOwnPropertyDescriptor","undefined","get","set","initialAttributes","WeakMap","reflectAttribute","value","initial","byName","Map","has","getAttribute","initialAttribute","removeAttribute","setAttribute","writeAttribute","WcsFullscreen","HTMLElement","wcBindable","inputs","attribute","_core","_connectedCallbackPromise","_internals","_initInternals","_wireStates","debugStates","states","attachInternals","internals","add","delete","map","toStates","entries","debug","hasAttribute","on","toggleAttribute","connectedCallbackPromise","_resolveTarget","display","scope","getRootNode","_safeQuery","child","firstElementChild","selector","querySelector","_reresolve","style","connectedCallback","declaration","input","record","upgradeProperties","disconnectedCallback","attributeChangedCallback","_name","oldValue","newValue","isConnected","registry","customElements","define","registerComponents"],"mappings":"AAQA,MA0BaA,EA1BoB,CAC/BC,SAAU,CACRC,WAAY,mBCUHC,EAEQ,qBAFRA,EAIM,mBAJNA,EAMC,cANDA,EAQM,mBAeb,SAAUC,EAA0BC,EAAgBC,GACxD,MAAMC,EAbR,SAAmBF,GACjB,MAAmE,iBAApDA,GAAwCE,QAClDF,EAA8BE,QAC/BC,OAAOH,EACb,CASkBI,CAAUJ,GAC1B,GAAa,uBAATC,EACF,MAAO,CAAEI,KAAMP,EAA6CQ,MAAO,QAASC,aAAa,EAAOL,WAElG,GAAa,qBAATD,EACF,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e9F,EAA2DP,aAAamE,WACvFC,EAASiC,GAAajC,OAC5B,QAAenB,IAAXmB,EACJ,IAAK,MAAMkC,KAASlC,EAAQ,CAC1B,MAAM7F,EAAO+H,EAAM/H,KACnB,IAAKoD,OAAOC,UAAUC,eAAeR,KAAKd,EAAShC,GAAO,SAC1D,IAAKqE,EAAuBrC,EAAShC,GAAO,SAC5C,MAAMgI,EAAShG,EACTgD,EAAQgD,EAAOhI,UACdgI,EAAOhI,GACdgI,EAAOhI,GAAQgF,CACjB,CACF,CE8HIiD,CAAkBrG,MAClBA,KAAK+F,aACL/F,KAAKoE,0BAA4BpE,KAAKmE,MAAM7D,SAC9C,CAEA,oBAAAgG,GACEtG,KAAKmE,MAAMxD,SACb,CAEA,wBAAA4F,CAAyBC,EAAeC,EAAyBC,GAC3DD,IAAaC,GACZ1G,KAAK2G,aACV3G,KAAK+F,YACP,EClMI,IAA4Da,GCI5D,SAA6BA,EAAkCC,gBAC9DD,EAAS7D,IAAIxF,EAAOC,SAASC,aAChCmJ,EAASE,OAAOvJ,EAAOC,SAASC,WAAYqG,EAEhD,CDJEiD,CAAmBH"}
|
package/dist/index.d.ts
CHANGED
|
@@ -201,7 +201,7 @@ declare class WcsFullscreen extends HTMLElement {
|
|
|
201
201
|
private _wireStates;
|
|
202
202
|
get connectedCallbackPromise(): Promise<void>;
|
|
203
203
|
get target(): string;
|
|
204
|
-
set target(value: string);
|
|
204
|
+
set target(value: string | null | undefined);
|
|
205
205
|
get active(): boolean;
|
|
206
206
|
get error(): any;
|
|
207
207
|
get errorInfo(): WcsIoErrorInfo | null;
|
package/dist/index.esm.js
CHANGED
|
@@ -413,6 +413,53 @@ function upgradeProperties(element) {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
// ===========================================================================
|
|
417
|
+
// AUTO-GENERATED FILE - DO NOT EDIT.
|
|
418
|
+
// Generated from /protocol/input-attribute.ts by scripts/sync-protocol-types.mjs.
|
|
419
|
+
// Run `node scripts/sync-protocol-types.mjs` after editing the source.
|
|
420
|
+
// ===========================================================================
|
|
421
|
+
// 属性へ反映する wc-bindable 入力の producer 側(SPEC-extensions § Producer guidance for inputs の P1〜P3)。
|
|
422
|
+
// 入力の setter は属性をこの 2 関数で書く。それで次が揃う:
|
|
423
|
+
// - `undefined` は「値が無い」(P1): 属性を、この関数で最初に書く前の状態 — マークアップに書かれた値、
|
|
424
|
+
// 無ければ属性なし(= その入力の文書化した既定値)— へ戻す。applier プロファイルを宣言する binder は
|
|
425
|
+
// 値の後の `undefined` を書き(A2)、React 19 も書き、直接の代入でも届く。
|
|
426
|
+
// - `null` はクリア(P2): 属性なし、つまり文書化した既定値。
|
|
427
|
+
// - どちらも文字列 "undefined" / "null" として属性に入らない。
|
|
428
|
+
//
|
|
429
|
+
// 「最初に書く前」は、その最初の書き込みのときに読む(遅延)。upgrade 前に代入されたプロパティは
|
|
430
|
+
// connectedCallback の upgradeProperties() が通し直すので、そのときにはパーサが書いた属性が揃っている。
|
|
431
|
+
// 要素自身が setter を通さずに書いた属性は、最初の書き込みより前なら「最初の状態」に含まれる。
|
|
432
|
+
//
|
|
433
|
+
// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/input-attribute.ts), then run
|
|
434
|
+
// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies
|
|
435
|
+
// (packages/<pkg>/src/protocol/inputAttribute.ts). Those copies are generated — do not edit them.
|
|
436
|
+
const initialAttributes = new WeakMap();
|
|
437
|
+
/** The attribute as it stood before the first write through these helpers. */
|
|
438
|
+
function initialAttribute(el, name) {
|
|
439
|
+
let byName = initialAttributes.get(el);
|
|
440
|
+
if (byName === undefined) {
|
|
441
|
+
byName = new Map();
|
|
442
|
+
initialAttributes.set(el, byName);
|
|
443
|
+
}
|
|
444
|
+
if (!byName.has(name))
|
|
445
|
+
byName.set(name, el.getAttribute(name));
|
|
446
|
+
return byName.get(name);
|
|
447
|
+
}
|
|
448
|
+
function writeAttribute(el, name, value) {
|
|
449
|
+
if (value === null)
|
|
450
|
+
el.removeAttribute(name);
|
|
451
|
+
else
|
|
452
|
+
el.setAttribute(name, value);
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* A value attribute. `value` is written as `String(value)`; `null` removes the attribute;
|
|
456
|
+
* `undefined` restores the attribute the element started with.
|
|
457
|
+
*/
|
|
458
|
+
function reflectAttribute(el, name, value) {
|
|
459
|
+
const initial = initialAttribute(el, name);
|
|
460
|
+
writeAttribute(el, name, value === undefined ? initial : value === null ? null : String(value));
|
|
461
|
+
}
|
|
462
|
+
|
|
416
463
|
/**
|
|
417
464
|
* `<wcs-fullscreen target="...">` — declarative Fullscreen API control.
|
|
418
465
|
*
|
|
@@ -513,8 +560,13 @@ class WcsFullscreen extends HTMLElement {
|
|
|
513
560
|
get target() {
|
|
514
561
|
return this.getAttribute("target") ?? "";
|
|
515
562
|
}
|
|
563
|
+
// Never lets setAttribute stringify null / undefined (an "undefined" selector
|
|
564
|
+
// resolves nothing): `null` removes the attribute (the first-child default),
|
|
565
|
+
// `undefined` restores the attribute the element started with (wc-bindable
|
|
566
|
+
// producer guidance P1; React 19 and a direct assignment deliver it,
|
|
567
|
+
// @wcstack/state does not).
|
|
516
568
|
set target(value) {
|
|
517
|
-
this
|
|
569
|
+
reflectAttribute(this, "target", value);
|
|
518
570
|
}
|
|
519
571
|
// --- Core delegated getters ---
|
|
520
572
|
get active() {
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/config.ts","../src/core/fullscreenCapabilities.ts","../src/core/FullscreenCore.ts","../src/protocol/upgradeProperties.ts","../src/components/Fullscreen.ts","../src/registerComponents.ts","../src/bootstrapFullscreen.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n fullscreen: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n fullscreen: \"wcs-fullscreen\",\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\n/** A misspelt option would otherwise do nothing: `bootstrapFullscreen` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/fullscreen] bootstrapFullscreen: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","/**\n * fullscreenCapabilities.ts\n *\n * Fullscreen node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。fullscreen は referenced element を操作するモニタ的ノードで競合 operation\n * を持たないため lane は無く、error taxonomy(errorInfo)のみを採用する。\n *\n * `_setError` は合成 `{ message }`(target 未解決 / API 非対応)と caught 例外\n * (`NotAllowedError` / `TypeError` = user gesture 外の requestFullscreen 拒否)を混在\n * 受理する。呼出側が明示 `code` を渡して合成側を曖昧さ無く分類し、caught は `.name` で\n * 分類する(storage / screen-orientation と同じ discriminator 方式)。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 明示 code discriminator(合成エラーの呼出側が渡す)。 */\nexport type FullscreenErrorKind = \"capability-missing\" | \"invalid-argument\";\n\n/** 安定した fullscreen error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_FULLSCREEN_ERROR_CODE = {\n /** Fullscreen API 非対応。 */\n CapabilityMissing: \"capability-missing\",\n /** target selector が要素に解決しない等の入力不備。 */\n InvalidArgument: \"invalid-argument\",\n /** `NotAllowedError` / `TypeError` — user gesture 外での要求拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の caught 例外。 */\n FullscreenError: \"fullscreen-error\",\n} as const;\n\nfunction messageOf(error: unknown): string {\n return typeof (error as { message?: unknown } | null)?.message === \"string\"\n ? (error as { message: string }).message\n : String(error);\n}\n\n/**\n * fullscreen の失敗を serializable な error taxonomy に写す。`kind` は合成エラーの\n * 呼出側が渡す明示 discriminator(`capability-missing` / `invalid-argument`)。未指定は\n * caught 例外を意味し、`.name` で分類する。`NotAllowedError` / `TypeError` は user\n * gesture 内で再試行すれば成功しうるため recoverable=true。\n */\nexport function deriveFullscreenErrorInfo(error: unknown, kind?: FullscreenErrorKind): WcsIoErrorInfo {\n const message = messageOf(error);\n if (kind === \"capability-missing\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (kind === \"invalid-argument\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.InvalidArgument, phase: \"start\", recoverable: false, message };\n }\n const name = (error as { name?: unknown } | null)?.name;\n if (name === \"NotAllowedError\" || name === \"TypeError\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.NotAllowed, phase: \"execute\", recoverable: true, message };\n }\n return { code: WCS_FULLSCREEN_ERROR_CODE.FullscreenError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveFullscreenErrorInfo, FullscreenErrorKind } from \"./fullscreenCapabilities.js\";\n\n/**\n * Headless Fullscreen API primitive. Unlike most wcstack IO nodes, this Core\n * does not operate on itself: it drives `requestFullscreen()` /\n * `exitFullscreen()` on a *referenced* Element that the Shell resolves via its\n * `target` attribute (docs/fullscreen-tag-design.md §0). The Core only ever\n * receives already-resolved `Element`s from its callers — it has no opinion on\n * how `target` selectors are parsed.\n *\n * `document.fullscreenElement` is a single document-wide value, so this Core\n * always compares against the *last element it resolved* (via\n * `requestFullscreen()`/`setTarget()`), never against \"is the document\n * fullscreen at all\" — that comparison is what keeps multiple concurrent\n * `<wcs-fullscreen>` instances from all reporting the same `active` value\n * (docs/fullscreen-tag-design.md §2.1, MUST).\n */\nexport class FullscreenCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"active\", event: \"wcs-fullscreen:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.active },\n // `error` / `errorInfo` are observable failure outputs. Historically `error`\n // was an imperative getter with no event; both are now bindable (event-backed)\n // so `data-wcs` / bind() can observe a request/exit failure. `errorInfo` is the\n // additive serializable taxonomy (stable code / phase / recoverable) derived\n // from `error`; the `error` value shape is unchanged. No lane — fullscreen\n // drives a referenced element, not a competing operation.\n { name: \"error\", event: \"wcs-fullscreen:error\", semantics: \"state\" },\n { name: \"errorInfo\", event: \"wcs-fullscreen:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestFullscreen\", async: true },\n { name: \"exitFullscreen\", async: true },\n ],\n };\n\n private _target: EventTarget;\n private _active: boolean = false;\n // Single error slot (§8): null means \"no recent failure\". Fullscreen's\n // gesture-rejection failure is a one-shot event, not a persistent state\n // machine like permission's 4-value surface — active/error are two\n // orthogonal, independently-observable axes.\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n\n // The last Element this Core resolved via requestFullscreen()/setTarget().\n // Compared against document.fullscreenElement on every fullscreenchange so\n // each instance judges only its own target (§2.1). null means \"no target\n // resolved yet\" — active must stay false in that case.\n private _resolvedTarget: Element | null = null;\n\n // Generation guard (§6): Core-scoped (one per Core, not per-target),\n // mirroring fetch/upload. document.fullscreenElement is a single\n // document-wide slot, so at most one in-flight request/exit is meaningful\n // per Core at a time.\n private _gen = 0;\n\n // True once observe() has attached the document-level fullscreenchange\n // listener. Guards observe() so a redundant call does not double-subscribe;\n // dispose() resets it so a later observe() resumes cleanly.\n private _subscribed = false;\n\n // SSR (§10): no asynchronous probe to await — observe() completes\n // synchronously, so readiness is 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 active(): boolean {\n return this._active;\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-fullscreen:error-info-changed`), derived from `error`; the existing\n * `error` value shape is unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Update the resolved target without issuing a fullscreen request (e.g. the\n * Shell re-resolves `target` on attribute change / connect). Re-evaluates\n * `active` against the current `document.fullscreenElement` so the state\n * stays correct even if the target changed while already fullscreen.\n */\n setTarget(element: Element | null): void {\n this._resolvedTarget = element;\n this._applyActive();\n }\n\n // Lifecycle (§10/§3.5). Idempotent: a second observe() while already\n // subscribed is a no-op (no double listener). Synchronous overall (no probe\n // to await), so the returned promise is only for API uniformity with other\n // IO nodes.\n observe(): Promise<void> {\n if (!this._subscribed) {\n this._subscribed = true;\n document.addEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n return this._ready;\n }\n\n dispose(): void {\n this._gen++;\n if (this._subscribed) {\n this._subscribed = false;\n document.removeEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n }\n\n /**\n * Request fullscreen on `element`. never-throw (§3/§6): a missing API or a\n * rejected promise (e.g. a `TypeError` from a call outside a user\n * gesture, per the WHATWG Fullscreen spec's transient-activation check) is\n * caught and surfaced via `error`, never thrown. The caller\n * (Shell) is responsible for resolving `target` and for ensuring this is\n * invoked from within an actual user gesture — this Core cannot manufacture\n * one (docs/fullscreen-tag-design.md §3).\n */\n async requestFullscreen(element: Element | null): Promise<void> {\n const gen = ++this._gen;\n this._resolvedTarget = element;\n if (!element) {\n // Distinct from \"API is not supported\" (below): the Shell's `target`\n // selector did not resolve to any element (missing/typo'd selector).\n // Conflating the two previously misled users into thinking Fullscreen\n // itself was unsupported when only their selector was wrong.\n this._setError({ message: \"Fullscreen target could not be resolved.\" }, \"invalid-argument\");\n return;\n }\n const fn = this._requestFullscreenFn(element);\n if (!fn) {\n this._setError({ message: \"Fullscreen API is not supported.\" }, \"capability-missing\");\n return;\n }\n try {\n await fn.call(element);\n if (gen !== this._gen) return; // stale: dispose()/superseding call ran\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n /**\n * Exit fullscreen. Silent no-op (§7) when nothing is currently fullscreen or\n * the API is unsupported — both are treated as \"already achieved the exit\n * intent\", not as errors, keeping repeated calls safe and never-throw.\n */\n async exitFullscreen(): Promise<void> {\n // no-op checks come BEFORE the generation bump: a call that does nothing\n // must not supersede an in-flight requestFullscreen() — bumping first\n // would make the pending request's settle handling stale and silently\n // swallow its error/active updates.\n if (this._fullscreenElement() === null) return; // already not fullscreen: silent no-op\n const fn = this._exitFullscreenFn();\n if (!fn) return; // unsupported: silent no-op (semantically already \"not fullscreen\")\n const gen = ++this._gen;\n try {\n await fn();\n if (gen !== this._gen) return; // stale\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n // --- API resolution layer (§4): call-time, never cached. Lets tests\n // install/remove the standard/legacy APIs freely and lets an unsupported\n // environment be detected correctly on every call. ---\n\n private _requestFullscreenFn(el: Element): (() => Promise<void>) | undefined {\n return this._elementFullscreenFn(el, \"requestFullscreen\")\n ?? this._elementFullscreenFn(el, \"webkitRequestFullscreen\");\n }\n\n // Resolve a fullscreen method for `el` WITHOUT a naive `el[name]` lookup.\n // A plain lookup walks the whole prototype chain — and <wcs-fullscreen>\n // itself declares a `requestFullscreen()` *command* method, so when the\n // resolved target is the Shell element (target=\"self\", or target omitted\n // with no children), the naive lookup would find the Shell's own command\n // instead of the platform API and recurse infinitely (stack overflow).\n // Instead: check the element's own properties (how tests install stubs —\n // happy-dom has no Fullscreen API — and how a deliberate per-element\n // monkey-patch would appear), then jump straight to Element.prototype,\n // where the platform defines the real methods. Both the standard and the\n // legacy webkit name go through this same resolution for symmetry.\n private _elementFullscreenFn(el: Element, name: string): (() => Promise<void>) | undefined {\n if (Object.prototype.hasOwnProperty.call(el, name)) {\n return (el as any)[name];\n }\n return (Element.prototype as any)[name];\n }\n\n private _exitFullscreenFn(): (() => Promise<void>) | undefined {\n const d = document as any;\n return d.exitFullscreen?.bind(document) ?? d.webkitExitFullscreen?.bind(document);\n }\n\n private _fullscreenElement(): Element | null {\n const d = document as any;\n return d.fullscreenElement ?? d.webkitFullscreenElement ?? null;\n }\n\n private _fullscreenChangeEventName(): string {\n return \"onfullscreenchange\" in document ? \"fullscreenchange\" : \"webkitfullscreenchange\";\n }\n\n // --- Internal ---\n\n private _onFullscreenChange = (): void => {\n this._applyActive();\n };\n\n // Re-derive `active` by comparing document.fullscreenElement (incl. legacy\n // fallback) against *this instance's* resolved target (§2/§2.1/§5). A null\n // resolved target always yields active=false — there is nothing for this\n // instance to claim as \"mine\".\n private _applyActive(): void {\n const next = this._resolvedTarget !== null && this._fullscreenElement() === this._resolvedTarget;\n this._setActive(next);\n }\n\n private _setActive(v: boolean): void {\n if (this._active === v) return; // same-value guard (§3.3 MUST)\n this._active = v;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:change\", {\n detail: { active: v },\n bubbles: true,\n }));\n }\n\n // `kind` is an explicit taxonomy discriminator passed only from the synthetic\n // error sites (unsupported / unresolved target); caught exceptions pass no kind\n // and are classified by their `.name`. Both `error` and the additive `errorInfo`\n // are now event-backed so a request/exit failure is observable via bind().\n private _setError(error: any, kind?: FullscreenErrorKind): void {\n // Same-value guard on reference: each failure builds a fresh object and the\n // clear path passes the literal null, so this only suppresses redundant\n // null→null (a successful request/exit clearing an already-null error).\n if (this._error === error) return;\n this._error = error;\n // Keep the additive errorInfo taxonomy in sync; fire it before the `error`\n // event so an observer of both sees the classification first (io-node family).\n this._commitErrorInfo(error === null ? null : deriveFullscreenErrorInfo(error, kind));\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (already reference-guarded), so errorInfo\n // transitions exactly when error does — no separate guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error-info-changed\", {\n detail: info,\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 } from \"../types.js\";\nimport { FullscreenCore } from \"../core/FullscreenCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\n\n/**\n * `<wcs-fullscreen target=\"...\">` — declarative Fullscreen API control.\n *\n * Like `intersection`/`resize`, this Shell operates on a *referenced* element,\n * not itself (docs/fullscreen-tag-design.md §0): `target` resolves which\n * element `requestFullscreen()`/`exitFullscreen()` are invoked on, using the\n * exact same 3-mode resolution as `<wcs-intersect>`\n * (docs/fullscreen-tag-design.md §1):\n *\n * | `target` | operates on | display | use case |\n * |-----------------|-------------------------|-------------|--------------------------|\n * | omitted | first element child | `contents` | wrap a gallery image/video |\n * | `\"#hero\"` / sel | the matched element | `none` | point at a distant node |\n * | `\"self\"` | the element itself | `block` | fullscreen the wrapper |\n *\n * `requestFullscreen()` requires an active user gesture — this element cannot\n * manufacture one. Invoke the command from within a real click handler\n * (typically via the command-token protocol: this element subscribes with\n * `command.requestFullscreen: $command.<token>`, and a button emits the\n * token from its own click handler, e.g. `onclick: $command.<token>`).\n */\nexport class WcsFullscreen extends HTMLElement {\n // SSR (§10): the fullscreenchange subscription is established synchronously\n // on connect, but the Shell still exposes connectedCallbackPromise so the\n // state binder can await it uniformly across all IO nodes before\n // snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static observedAttributes = [\"target\"];\n\n static wcBindable: IWcBindable = {\n ...FullscreenCore.wcBindable,\n inputs: [{ name: \"target\", attribute: \"target\" }],\n // Core の commands をそのまま継承(単一情報源)。network/intersection と同型。\n commands: FullscreenCore.wcBindable.commands,\n };\n\n private _core: FullscreenCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new FullscreenCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-fullscreen:change\": (d) => ({ active: d?.active === true }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Attribute accessors ---\n\n get target(): string {\n return this.getAttribute(\"target\") ?? \"\";\n }\n\n set target(value: string) {\n this.setAttribute(\"target\", value);\n }\n\n // --- Core delegated getters ---\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n // --- Commands ---\n\n /**\n * Resolve `target` and request fullscreen on it. never-throw: an\n * unresolvable target or an unsupported/rejected API call are both\n * surfaced via `error`, never thrown (docs/fullscreen-tag-design.md §3/§6).\n */\n async requestFullscreen(): Promise<void> {\n const { element } = this._resolveTarget();\n await this._core.requestFullscreen(element);\n }\n\n async exitFullscreen(): Promise<void> {\n await this._core.exitFullscreen();\n }\n\n // --- Internal ---\n\n // Copied verbatim from <wcs-intersect> (Intersect.ts _resolveTarget/_safeQuery,\n // docs/fullscreen-tag-design.md §1): identical 3-mode resolution, only the\n // \"what to do with the resolved element\" step differs.\n private _resolveTarget(): { element: Element | null; display: string } {\n const target = this.target;\n if (target === \"self\") {\n return { element: this, display: \"block\" };\n }\n if (target !== \"\") {\n const scope = this.getRootNode() as Document | ShadowRoot;\n return { element: this._safeQuery(scope, target), display: \"none\" };\n }\n const child = this.firstElementChild;\n if (child) {\n return { element: child, display: \"contents\" };\n }\n return { element: this, display: \"block\" };\n }\n\n private _safeQuery(scope: Document | ShadowRoot, selector: string): Element | null {\n try {\n return scope.querySelector(selector);\n } catch {\n return null;\n }\n }\n\n private _reresolve(): void {\n const { element, display } = this._resolveTarget();\n this.style.display = display;\n this._core.setTarget(element);\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this._reresolve();\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return;\n if (!this.isConnected) return;\n this._reresolve();\n }\n}\n","import { WcsFullscreen } from \"./components/Fullscreen.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.fullscreen)) {\n registry.define(config.tagNames.fullscreen, WcsFullscreen);\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapFullscreen(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,UAAU,EAAE,gBAAgB;AAC7B,KAAA;CACF;AAED,SAAS,UAAU,CAAI,GAAM,EAAA;AAC3B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;AACvD,IAAA,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;IAClB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAClC,QAAA,UAAU,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC;IACnD;AACA,IAAA,OAAO,GAAG;AACZ;AAEA,SAAS,SAAS,CAAI,GAAM,EAAA;AAC1B,IAAA,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,QAAA,OAAO,GAAG;IACvD,MAAM,KAAK,GAA4B,EAAE;IACzC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAClC,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAE,GAA+B,CAAC,GAAG,CAAC,CAAC;IAC/D;AACA,IAAA,OAAO,KAAU;AACnB;AAEA,IAAI,YAAY,GAAmB,IAAI;AAEhC,MAAM,MAAM,GAAY,OAAkB;SAEjC,SAAS,GAAA;IACvB,IAAI,CAAC,YAAY,EAAE;QACjB,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/C;AACA,IAAA,OAAO,YAAY;AACrB;AAEA;AACA,SAAS,OAAO,CAAC,GAAW,EAAA;AAC1B,IAAA,MAAM,IAAI,KAAK,CAAC,+CAA+C,GAAG,CAAA,yDAAA,CAA2D,CAAC;AAChI;AAEA;;;;AAIG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G,SAAU,kBAAkB,CAAC,QAAA,GAAkC,cAAc,EAAA;AACjF,IAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC7C,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IAC5D;AACF;;ACRM,SAAU,mBAAmB,CAAC,UAA4B,EAAE,QAAgC,EAAA;IAChG,IAAI,UAAU,EAAE;QACd,SAAS,CAAC,UAAU,CAAC;IACvB;IACA,kBAAkB,CAAC,QAAQ,CAAC;AAC9B;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/config.ts","../src/core/fullscreenCapabilities.ts","../src/core/FullscreenCore.ts","../src/protocol/upgradeProperties.ts","../src/protocol/inputAttribute.ts","../src/components/Fullscreen.ts","../src/registerComponents.ts","../src/bootstrapFullscreen.ts"],"sourcesContent":["import { IConfig, IWritableConfig } from \"./types.js\";\n\ninterface IInternalConfig extends IConfig {\n tagNames: {\n fullscreen: string;\n };\n}\n\nconst _config: IInternalConfig = {\n tagNames: {\n fullscreen: \"wcs-fullscreen\",\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\n/** A misspelt option would otherwise do nothing: `bootstrapFullscreen` refuses it. */\nfunction invalid(key: string): never {\n throw new Error(`[@wcstack/fullscreen] bootstrapFullscreen: \"${key}\" is not one of its options, or not of the option's type.`);\n}\n\n/**\n * Applies the options given; an undefined value is left out. An option this package does not\n * have, a value of another type than its default (null, or an array for an object, included) or\n * a tag name it does not define throws, and then nothing is applied.\n */\nexport function setConfig(partialConfig: IWritableConfig): void {\n const options = _config as unknown as Record<string, unknown>;\n const tags = _config.tagNames as Record<string, string>;\n const given = Object.entries(partialConfig).filter(([, value]) => value !== undefined);\n const givenTags = Object.entries(partialConfig.tagNames ?? {}).filter(([, tag]) => tag !== undefined);\n for (const [key, value] of given) {\n const current = options[key];\n if (!Object.hasOwn(options, key) || value === null || typeof value !== typeof current || Array.isArray(value) !== Array.isArray(current)) {\n invalid(key);\n }\n }\n for (const [name, tag] of givenTags) {\n if (!Object.hasOwn(tags, name) || typeof tag !== \"string\") invalid(`tagNames.${name}`);\n }\n for (const [name, tag] of givenTags) tags[name] = tag as string;\n frozenConfig = null;\n}\n","/**\n * fullscreenCapabilities.ts\n *\n * Fullscreen node 固有の error code(taxonomy)と derivation。汎用の error info 型は\n * `./platformCapability.js`(/io-core/ から copy-distribution される生成ファイル)から\n * import する。fullscreen は referenced element を操作するモニタ的ノードで競合 operation\n * を持たないため lane は無く、error taxonomy(errorInfo)のみを採用する。\n *\n * `_setError` は合成 `{ message }`(target 未解決 / API 非対応)と caught 例外\n * (`NotAllowedError` / `TypeError` = user gesture 外の requestFullscreen 拒否)を混在\n * 受理する。呼出側が明示 `code` を渡して合成側を曖昧さ無く分類し、caught は `.name` で\n * 分類する(storage / screen-orientation と同じ discriminator 方式)。\n */\n\nimport type { WcsIoErrorInfo } from \"./platformCapability.js\";\n\n/** 明示 code discriminator(合成エラーの呼出側が渡す)。 */\nexport type FullscreenErrorKind = \"capability-missing\" | \"invalid-argument\";\n\n/** 安定した fullscreen error code(taxonomy)。値は公開キーとして固定。 */\nexport const WCS_FULLSCREEN_ERROR_CODE = {\n /** Fullscreen API 非対応。 */\n CapabilityMissing: \"capability-missing\",\n /** target selector が要素に解決しない等の入力不備。 */\n InvalidArgument: \"invalid-argument\",\n /** `NotAllowedError` / `TypeError` — user gesture 外での要求拒否。 */\n NotAllowed: \"not-allowed\",\n /** その他の caught 例外。 */\n FullscreenError: \"fullscreen-error\",\n} as const;\n\nfunction messageOf(error: unknown): string {\n return typeof (error as { message?: unknown } | null)?.message === \"string\"\n ? (error as { message: string }).message\n : String(error);\n}\n\n/**\n * fullscreen の失敗を serializable な error taxonomy に写す。`kind` は合成エラーの\n * 呼出側が渡す明示 discriminator(`capability-missing` / `invalid-argument`)。未指定は\n * caught 例外を意味し、`.name` で分類する。`NotAllowedError` / `TypeError` は user\n * gesture 内で再試行すれば成功しうるため recoverable=true。\n */\nexport function deriveFullscreenErrorInfo(error: unknown, kind?: FullscreenErrorKind): WcsIoErrorInfo {\n const message = messageOf(error);\n if (kind === \"capability-missing\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.CapabilityMissing, phase: \"probe\", recoverable: false, message };\n }\n if (kind === \"invalid-argument\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.InvalidArgument, phase: \"start\", recoverable: false, message };\n }\n const name = (error as { name?: unknown } | null)?.name;\n if (name === \"NotAllowedError\" || name === \"TypeError\") {\n return { code: WCS_FULLSCREEN_ERROR_CODE.NotAllowed, phase: \"execute\", recoverable: true, message };\n }\n return { code: WCS_FULLSCREEN_ERROR_CODE.FullscreenError, phase: \"execute\", recoverable: false, message };\n}\n","import { IWcBindable } from \"../types.js\";\nimport { WcsIoErrorInfo } from \"./platformCapability.js\";\nimport { deriveFullscreenErrorInfo, FullscreenErrorKind } from \"./fullscreenCapabilities.js\";\n\n/**\n * Headless Fullscreen API primitive. Unlike most wcstack IO nodes, this Core\n * does not operate on itself: it drives `requestFullscreen()` /\n * `exitFullscreen()` on a *referenced* Element that the Shell resolves via its\n * `target` attribute (docs/fullscreen-tag-design.md §0). The Core only ever\n * receives already-resolved `Element`s from its callers — it has no opinion on\n * how `target` selectors are parsed.\n *\n * `document.fullscreenElement` is a single document-wide value, so this Core\n * always compares against the *last element it resolved* (via\n * `requestFullscreen()`/`setTarget()`), never against \"is the document\n * fullscreen at all\" — that comparison is what keeps multiple concurrent\n * `<wcs-fullscreen>` instances from all reporting the same `active` value\n * (docs/fullscreen-tag-design.md §2.1, MUST).\n */\nexport class FullscreenCore extends EventTarget {\n static wcBindable: IWcBindable = {\n protocol: \"wc-bindable\",\n version: 1,\n properties: [\n { name: \"active\", event: \"wcs-fullscreen:change\", semantics: \"state\", getter: (e: Event) => (e as CustomEvent).detail.active },\n // `error` / `errorInfo` are observable failure outputs. Historically `error`\n // was an imperative getter with no event; both are now bindable (event-backed)\n // so `data-wcs` / bind() can observe a request/exit failure. `errorInfo` is the\n // additive serializable taxonomy (stable code / phase / recoverable) derived\n // from `error`; the `error` value shape is unchanged. No lane — fullscreen\n // drives a referenced element, not a competing operation.\n { name: \"error\", event: \"wcs-fullscreen:error\", semantics: \"state\" },\n { name: \"errorInfo\", event: \"wcs-fullscreen:error-info-changed\", semantics: \"state\" },\n ],\n commands: [\n { name: \"requestFullscreen\", async: true },\n { name: \"exitFullscreen\", async: true },\n ],\n };\n\n private _target: EventTarget;\n private _active: boolean = false;\n // Single error slot (§8): null means \"no recent failure\". Fullscreen's\n // gesture-rejection failure is a one-shot event, not a persistent state\n // machine like permission's 4-value surface — active/error are two\n // orthogonal, independently-observable axes.\n private _error: any = null;\n private _errorInfo: WcsIoErrorInfo | null = null;\n\n // The last Element this Core resolved via requestFullscreen()/setTarget().\n // Compared against document.fullscreenElement on every fullscreenchange so\n // each instance judges only its own target (§2.1). null means \"no target\n // resolved yet\" — active must stay false in that case.\n private _resolvedTarget: Element | null = null;\n\n // Generation guard (§6): Core-scoped (one per Core, not per-target),\n // mirroring fetch/upload. document.fullscreenElement is a single\n // document-wide slot, so at most one in-flight request/exit is meaningful\n // per Core at a time.\n private _gen = 0;\n\n // True once observe() has attached the document-level fullscreenchange\n // listener. Guards observe() so a redundant call does not double-subscribe;\n // dispose() resets it so a later observe() resumes cleanly.\n private _subscribed = false;\n\n // SSR (§10): no asynchronous probe to await — observe() completes\n // synchronously, so readiness is 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 active(): boolean {\n return this._active;\n }\n\n get error(): any {\n return this._error;\n }\n\n /**\n * The last failure's serializable `WcsIoErrorInfo` (stable `code` / `phase` /\n * `recoverable`), or null. Additive wc-bindable property (event\n * `wcs-fullscreen:error-info-changed`), derived from `error`; the existing\n * `error` value shape is unchanged.\n */\n get errorInfo(): WcsIoErrorInfo | null {\n return this._errorInfo;\n }\n\n /**\n * Update the resolved target without issuing a fullscreen request (e.g. the\n * Shell re-resolves `target` on attribute change / connect). Re-evaluates\n * `active` against the current `document.fullscreenElement` so the state\n * stays correct even if the target changed while already fullscreen.\n */\n setTarget(element: Element | null): void {\n this._resolvedTarget = element;\n this._applyActive();\n }\n\n // Lifecycle (§10/§3.5). Idempotent: a second observe() while already\n // subscribed is a no-op (no double listener). Synchronous overall (no probe\n // to await), so the returned promise is only for API uniformity with other\n // IO nodes.\n observe(): Promise<void> {\n if (!this._subscribed) {\n this._subscribed = true;\n document.addEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n return this._ready;\n }\n\n dispose(): void {\n this._gen++;\n if (this._subscribed) {\n this._subscribed = false;\n document.removeEventListener(this._fullscreenChangeEventName(), this._onFullscreenChange);\n }\n }\n\n /**\n * Request fullscreen on `element`. never-throw (§3/§6): a missing API or a\n * rejected promise (e.g. a `TypeError` from a call outside a user\n * gesture, per the WHATWG Fullscreen spec's transient-activation check) is\n * caught and surfaced via `error`, never thrown. The caller\n * (Shell) is responsible for resolving `target` and for ensuring this is\n * invoked from within an actual user gesture — this Core cannot manufacture\n * one (docs/fullscreen-tag-design.md §3).\n */\n async requestFullscreen(element: Element | null): Promise<void> {\n const gen = ++this._gen;\n this._resolvedTarget = element;\n if (!element) {\n // Distinct from \"API is not supported\" (below): the Shell's `target`\n // selector did not resolve to any element (missing/typo'd selector).\n // Conflating the two previously misled users into thinking Fullscreen\n // itself was unsupported when only their selector was wrong.\n this._setError({ message: \"Fullscreen target could not be resolved.\" }, \"invalid-argument\");\n return;\n }\n const fn = this._requestFullscreenFn(element);\n if (!fn) {\n this._setError({ message: \"Fullscreen API is not supported.\" }, \"capability-missing\");\n return;\n }\n try {\n await fn.call(element);\n if (gen !== this._gen) return; // stale: dispose()/superseding call ran\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n /**\n * Exit fullscreen. Silent no-op (§7) when nothing is currently fullscreen or\n * the API is unsupported — both are treated as \"already achieved the exit\n * intent\", not as errors, keeping repeated calls safe and never-throw.\n */\n async exitFullscreen(): Promise<void> {\n // no-op checks come BEFORE the generation bump: a call that does nothing\n // must not supersede an in-flight requestFullscreen() — bumping first\n // would make the pending request's settle handling stale and silently\n // swallow its error/active updates.\n if (this._fullscreenElement() === null) return; // already not fullscreen: silent no-op\n const fn = this._exitFullscreenFn();\n if (!fn) return; // unsupported: silent no-op (semantically already \"not fullscreen\")\n const gen = ++this._gen;\n try {\n await fn();\n if (gen !== this._gen) return; // stale\n this._setError(null);\n this._applyActive();\n } catch (e: any) {\n if (gen !== this._gen) return; // stale\n this._setError(e);\n }\n }\n\n // --- API resolution layer (§4): call-time, never cached. Lets tests\n // install/remove the standard/legacy APIs freely and lets an unsupported\n // environment be detected correctly on every call. ---\n\n private _requestFullscreenFn(el: Element): (() => Promise<void>) | undefined {\n return this._elementFullscreenFn(el, \"requestFullscreen\")\n ?? this._elementFullscreenFn(el, \"webkitRequestFullscreen\");\n }\n\n // Resolve a fullscreen method for `el` WITHOUT a naive `el[name]` lookup.\n // A plain lookup walks the whole prototype chain — and <wcs-fullscreen>\n // itself declares a `requestFullscreen()` *command* method, so when the\n // resolved target is the Shell element (target=\"self\", or target omitted\n // with no children), the naive lookup would find the Shell's own command\n // instead of the platform API and recurse infinitely (stack overflow).\n // Instead: check the element's own properties (how tests install stubs —\n // happy-dom has no Fullscreen API — and how a deliberate per-element\n // monkey-patch would appear), then jump straight to Element.prototype,\n // where the platform defines the real methods. Both the standard and the\n // legacy webkit name go through this same resolution for symmetry.\n private _elementFullscreenFn(el: Element, name: string): (() => Promise<void>) | undefined {\n if (Object.prototype.hasOwnProperty.call(el, name)) {\n return (el as any)[name];\n }\n return (Element.prototype as any)[name];\n }\n\n private _exitFullscreenFn(): (() => Promise<void>) | undefined {\n const d = document as any;\n return d.exitFullscreen?.bind(document) ?? d.webkitExitFullscreen?.bind(document);\n }\n\n private _fullscreenElement(): Element | null {\n const d = document as any;\n return d.fullscreenElement ?? d.webkitFullscreenElement ?? null;\n }\n\n private _fullscreenChangeEventName(): string {\n return \"onfullscreenchange\" in document ? \"fullscreenchange\" : \"webkitfullscreenchange\";\n }\n\n // --- Internal ---\n\n private _onFullscreenChange = (): void => {\n this._applyActive();\n };\n\n // Re-derive `active` by comparing document.fullscreenElement (incl. legacy\n // fallback) against *this instance's* resolved target (§2/§2.1/§5). A null\n // resolved target always yields active=false — there is nothing for this\n // instance to claim as \"mine\".\n private _applyActive(): void {\n const next = this._resolvedTarget !== null && this._fullscreenElement() === this._resolvedTarget;\n this._setActive(next);\n }\n\n private _setActive(v: boolean): void {\n if (this._active === v) return; // same-value guard (§3.3 MUST)\n this._active = v;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:change\", {\n detail: { active: v },\n bubbles: true,\n }));\n }\n\n // `kind` is an explicit taxonomy discriminator passed only from the synthetic\n // error sites (unsupported / unresolved target); caught exceptions pass no kind\n // and are classified by their `.name`. Both `error` and the additive `errorInfo`\n // are now event-backed so a request/exit failure is observable via bind().\n private _setError(error: any, kind?: FullscreenErrorKind): void {\n // Same-value guard on reference: each failure builds a fresh object and the\n // clear path passes the literal null, so this only suppresses redundant\n // null→null (a successful request/exit clearing an already-null error).\n if (this._error === error) return;\n this._error = error;\n // Keep the additive errorInfo taxonomy in sync; fire it before the `error`\n // event so an observer of both sees the classification first (io-node family).\n this._commitErrorInfo(error === null ? null : deriveFullscreenErrorInfo(error, kind));\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error\", {\n detail: error,\n bubbles: true,\n }));\n }\n\n // Called only from _setError (already reference-guarded), so errorInfo\n // transitions exactly when error does — no separate guard needed here.\n private _commitErrorInfo(info: WcsIoErrorInfo | null): void {\n this._errorInfo = info;\n this._target.dispatchEvent(new CustomEvent(\"wcs-fullscreen:error-info-changed\", {\n detail: info,\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","// ===========================================================================\n// AUTO-GENERATED FILE - DO NOT EDIT.\n// Generated from /protocol/input-attribute.ts by scripts/sync-protocol-types.mjs.\n// Run `node scripts/sync-protocol-types.mjs` after editing the source.\n// ===========================================================================\n\n// 属性へ反映する wc-bindable 入力の producer 側(SPEC-extensions § Producer guidance for inputs の P1〜P3)。\n// 入力の setter は属性をこの 2 関数で書く。それで次が揃う:\n// - `undefined` は「値が無い」(P1): 属性を、この関数で最初に書く前の状態 — マークアップに書かれた値、\n// 無ければ属性なし(= その入力の文書化した既定値)— へ戻す。applier プロファイルを宣言する binder は\n// 値の後の `undefined` を書き(A2)、React 19 も書き、直接の代入でも届く。\n// - `null` はクリア(P2): 属性なし、つまり文書化した既定値。\n// - どちらも文字列 \"undefined\" / \"null\" として属性に入らない。\n//\n// 「最初に書く前」は、その最初の書き込みのときに読む(遅延)。upgrade 前に代入されたプロパティは\n// connectedCallback の upgradeProperties() が通し直すので、そのときにはパーサが書いた属性が揃っている。\n// 要素自身が setter を通さずに書いた属性は、最初の書き込みより前なら「最初の状態」に含まれる。\n//\n// SINGLE SOURCE OF TRUTH: edit only this file (/protocol/input-attribute.ts), then run\n// `node scripts/sync-protocol-types.mjs` to regenerate the per-package copies\n// (packages/<pkg>/src/protocol/inputAttribute.ts). Those copies are generated — do not edit them.\n\nconst initialAttributes = new WeakMap<Element, Map<string, string | null>>();\n\n/** The attribute as it stood before the first write through these helpers. */\nfunction initialAttribute(el: Element, name: string): string | null {\n let byName = initialAttributes.get(el);\n if (byName === undefined) {\n byName = new Map();\n initialAttributes.set(el, byName);\n }\n if (!byName.has(name)) byName.set(name, el.getAttribute(name));\n return byName.get(name) as string | null;\n}\n\nfunction writeAttribute(el: Element, name: string, value: string | null): void {\n if (value === null) el.removeAttribute(name);\n else el.setAttribute(name, value);\n}\n\n/**\n * A value attribute. `value` is written as `String(value)`; `null` removes the attribute;\n * `undefined` restores the attribute the element started with.\n */\nexport function reflectAttribute(el: Element, name: string, value: unknown): void {\n const initial = initialAttribute(el, name);\n writeAttribute(el, name, value === undefined ? initial : value === null ? null : String(value));\n}\n\n/**\n * A boolean attribute, present while `value` is truthy (`null` and `false` remove it);\n * `undefined` restores the attribute the element started with.\n */\nexport function reflectBooleanAttribute(el: Element, name: string, value: unknown): void {\n const initial = initialAttribute(el, name);\n writeAttribute(el, name, value === undefined ? initial : value ? \"\" : null);\n}\n","import { IWcBindable } from \"../types.js\";\nimport { FullscreenCore } from \"../core/FullscreenCore.js\";\nimport { WcsIoErrorInfo } from \"../core/platformCapability.js\";\nimport { upgradeProperties } from \"../protocol/upgradeProperties.js\";\nimport { reflectAttribute } from \"../protocol/inputAttribute.js\";\n\n/**\n * `<wcs-fullscreen target=\"...\">` — declarative Fullscreen API control.\n *\n * Like `intersection`/`resize`, this Shell operates on a *referenced* element,\n * not itself (docs/fullscreen-tag-design.md §0): `target` resolves which\n * element `requestFullscreen()`/`exitFullscreen()` are invoked on, using the\n * exact same 3-mode resolution as `<wcs-intersect>`\n * (docs/fullscreen-tag-design.md §1):\n *\n * | `target` | operates on | display | use case |\n * |-----------------|-------------------------|-------------|--------------------------|\n * | omitted | first element child | `contents` | wrap a gallery image/video |\n * | `\"#hero\"` / sel | the matched element | `none` | point at a distant node |\n * | `\"self\"` | the element itself | `block` | fullscreen the wrapper |\n *\n * `requestFullscreen()` requires an active user gesture — this element cannot\n * manufacture one. Invoke the command from within a real click handler\n * (typically via the command-token protocol: this element subscribes with\n * `command.requestFullscreen: $command.<token>`, and a button emits the\n * token from its own click handler, e.g. `onclick: $command.<token>`).\n */\nexport class WcsFullscreen extends HTMLElement {\n // SSR (§10): the fullscreenchange subscription is established synchronously\n // on connect, but the Shell still exposes connectedCallbackPromise so the\n // state binder can await it uniformly across all IO nodes before\n // snapshotting.\n static hasConnectedCallbackPromise = true;\n\n static observedAttributes = [\"target\"];\n\n static wcBindable: IWcBindable = {\n ...FullscreenCore.wcBindable,\n inputs: [{ name: \"target\", attribute: \"target\" }],\n // Core の commands をそのまま継承(単一情報源)。network/intersection と同型。\n commands: FullscreenCore.wcBindable.commands,\n };\n\n private _core: FullscreenCore;\n private _connectedCallbackPromise: Promise<void> = Promise.resolve();\n private _internals: ElementInternals | null = null;\n\n constructor() {\n super();\n this._core = new FullscreenCore(this);\n this._internals = this._initInternals();\n this._wireStates({\n \"wcs-fullscreen:change\": (d) => ({ active: d?.active === true }),\n });\n }\n\n // CSS state reflection (:state()) — debug-only snapshot getter. NOT part of\n // wc-bindable (not a bind target); see README \"CSS styling with :state()\".\n // MUST NOT return the live CustomStateSet (that would let callers write\n // states from outside, defeating the point of :state() being read-only).\n get debugStates(): string[] {\n return this._internals ? [...this._internals.states] : [];\n }\n\n private _initInternals(): ElementInternals | null {\n // never-throw (docs/custom-state-reflection-design.md §3.1): attachInternals\n // is absent in happy-dom / older environments, and pre-125 Chromium rejects\n // non-dashed state names from states.add() (probed and discarded here).\n // Either case silently disables reflection — the component still works,\n // it just doesn't expose :state() selectors.\n try {\n if (typeof this.attachInternals !== \"function\") return null;\n const internals = this.attachInternals();\n internals.states.add(\"wcs-probe\");\n internals.states.delete(\"wcs-probe\");\n return internals;\n } catch {\n return null;\n }\n }\n\n private _wireStates(map: Record<string, (detail: any) => Record<string, boolean>>): void {\n if (this._internals === null) return;\n const states = this._internals.states;\n for (const [event, toStates] of Object.entries(map)) {\n this.addEventListener(event, (e) => {\n const debug = this.hasAttribute(\"debug-states\");\n for (const [name, on] of Object.entries(toStates((e as CustomEvent).detail))) {\n try {\n if (on) { states.add(name); } else { states.delete(name); }\n } catch { /* never-throw */ }\n if (debug) this.toggleAttribute(`data-wcs-state-${name}`, on);\n }\n });\n }\n }\n\n get connectedCallbackPromise(): Promise<void> {\n return this._connectedCallbackPromise;\n }\n\n // --- Attribute accessors ---\n\n get target(): string {\n return this.getAttribute(\"target\") ?? \"\";\n }\n\n // Never lets setAttribute stringify null / undefined (an \"undefined\" selector\n // resolves nothing): `null` removes the attribute (the first-child default),\n // `undefined` restores the attribute the element started with (wc-bindable\n // producer guidance P1; React 19 and a direct assignment deliver it,\n // @wcstack/state does not).\n set target(value: string | null | undefined) {\n reflectAttribute(this, \"target\", value);\n }\n\n // --- Core delegated getters ---\n\n get active(): boolean {\n return this._core.active;\n }\n\n get error(): any {\n return this._core.error;\n }\n\n get errorInfo(): WcsIoErrorInfo | null {\n return this._core.errorInfo;\n }\n\n // --- Commands ---\n\n /**\n * Resolve `target` and request fullscreen on it. never-throw: an\n * unresolvable target or an unsupported/rejected API call are both\n * surfaced via `error`, never thrown (docs/fullscreen-tag-design.md §3/§6).\n */\n async requestFullscreen(): Promise<void> {\n const { element } = this._resolveTarget();\n await this._core.requestFullscreen(element);\n }\n\n async exitFullscreen(): Promise<void> {\n await this._core.exitFullscreen();\n }\n\n // --- Internal ---\n\n // Copied verbatim from <wcs-intersect> (Intersect.ts _resolveTarget/_safeQuery,\n // docs/fullscreen-tag-design.md §1): identical 3-mode resolution, only the\n // \"what to do with the resolved element\" step differs.\n private _resolveTarget(): { element: Element | null; display: string } {\n const target = this.target;\n if (target === \"self\") {\n return { element: this, display: \"block\" };\n }\n if (target !== \"\") {\n const scope = this.getRootNode() as Document | ShadowRoot;\n return { element: this._safeQuery(scope, target), display: \"none\" };\n }\n const child = this.firstElementChild;\n if (child) {\n return { element: child, display: \"contents\" };\n }\n return { element: this, display: \"block\" };\n }\n\n private _safeQuery(scope: Document | ShadowRoot, selector: string): Element | null {\n try {\n return scope.querySelector(selector);\n } catch {\n return null;\n }\n }\n\n private _reresolve(): void {\n const { element, display } = this._resolveTarget();\n this.style.display = display;\n this._core.setTarget(element);\n }\n\n // --- Lifecycle ---\n\n connectedCallback(): void {\n // upgrade 前に代入された input を取り込み直す(doc 13 §1.2 / Phase A1)\n upgradeProperties(this);\n this._reresolve();\n this._connectedCallbackPromise = this._core.observe();\n }\n\n disconnectedCallback(): void {\n this._core.dispose();\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return;\n if (!this.isConnected) return;\n this._reresolve();\n }\n}\n","import { WcsFullscreen } from \"./components/Fullscreen.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.fullscreen)) {\n registry.define(config.tagNames.fullscreen, WcsFullscreen);\n }\n}\n","import { setConfig } from \"./config.js\";\nimport { registerComponents } from \"./registerComponents.js\";\nimport { IWritableConfig } from \"./types.js\";\n\nexport function bootstrapFullscreen(userConfig?: IWritableConfig, registry?: CustomElementRegistry): void {\n if (userConfig) {\n setConfig(userConfig);\n }\n registerComponents(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M,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IAC5D;AACF;;ACRM,SAAU,mBAAmB,CAAC,UAA4B,EAAE,QAAgC,EAAA;IAChG,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/fullscreen",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Declarative Fullscreen API component for Web Components. Framework-agnostic requestFullscreen()/exitFullscreen() control via wc-bindable-protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.esm.js",
|