incajs 0.0.24 → 0.0.26
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/LICENSE-APACHE +201 -0
- package/LICENSE-MIT +21 -0
- package/dist/chunks/hooks-BbPHSiFF.js +2 -0
- package/dist/chunks/rendererCore-BaVb8wQu.js +1 -0
- package/dist/chunks/{rendererCore-qq38UzW-.d.ts → rendererCore-oCllOmUF.d.ts} +17 -22
- package/dist/chunks/{window-BtaK1Znc.d.ts → window-VD8HXwVy.d.ts} +99 -25
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/rendererCore.d.ts +3 -3
- package/dist/rendererCore.js +1 -1
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +2 -2
- package/package.json +4 -2
- package/LICENSE +0 -5
- package/dist/chunks/hooks-DK2feJxZ.js +0 -1
- package/dist/chunks/rendererCore-Ezb4FOC9.js +0 -1
package/LICENSE-APACHE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/LICENSE-MIT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tom96da
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function e(){return globalThis.__inca_native__}const t=/* @__PURE__ */ new Map;function n(n,r,i,a,o){if(typeof r!=`function`)throw TypeError(`${n} takes a function. pass a function as the handler`);let s=i|0,c=e().startTimer(s>0?s:0,o);if(c===void 0)throw RangeError(`timer ids are exhausted. restart the app`);return t.set(c,{handler:r,args:a,repeat:o}),c}function r(n){let r=n|0;t.delete(r)&&e().stopTimer(r)}Object.defineProperty(globalThis,"__inca_timer__",{value:n=>{let r=t.get(n);r===void 0?e().stopTimer(n):(r.repeat||t.delete(n),Reflect.apply(r.handler,globalThis,r.args))},configurable:!0}),typeof globalThis.__inca_native__?.startTimer==`function`&&Object.assign(globalThis,{setTimeout(e,t=0,...r){return n(`setTimeout`,e,t,r,!1)},setInterval(e,t=0,...r){return n(`setInterval`,e,t,r,!0)},clearTimeout(e=0){r(e)},clearInterval(e=0){r(e)}});const i=/* @__PURE__ */ `auxclick.beforeinput.blur.change.click.contextmenu.dblclick.focus.gotpointercapture.input.keydown.keypress.keyup.lostpointercapture.mousedown.mouseenter.mouseleave.mousemove.mouseout.mouseover.mouseup.pointerdown.pointerenter.pointerleave.pointermove.pointerout.pointerover.pointerup.scroll.wheel`.split(`.`);function a(e,t){for(let n of i){let r=null,i=function(e){typeof r==`function`&&Reflect.apply(r,this,[e])===!1&&e.preventDefault()};Object.defineProperty(e,`on${n}`,{get:()=>r,set(a){t()||(r=typeof a==`function`||typeof a==`object`&&a?a:null,r===null?e.removeEventListener(n,i):e.addEventListener(n,i))}})}return e}const o=/* @__PURE__ */ new WeakSet;function s(e,t){return o.add(e),Object.defineProperty(e,"__node_id",{value:t})}function c(e){return typeof e==`object`&&!!e&&o.has(e)}const l=/* @__PURE__ */ new Map,u=new FinalizationRegistry(e=>{l.get(e)?.deref()||l.delete(e)});function ee(e){l.set(e.__node_id,new WeakRef(e)),u.register(e,e.__node_id)}function te(e){l.delete(e)}function d(e){return l.get(e)?.deref()}const f=/* @__PURE__ */ new WeakSet;function p(e){return f.has(e)||h.has(e)}function m(e){if(f.add(e),e.kind!==`text`)for(let t of e.children)m(t)}const h=/* @__PURE__ */ new WeakSet;function g(e){return h.has(e)}function _(e){if(h.add(e),e.kind!==`text`){te(e.__node_id);for(let t of e.children)_(t)}}function ne(e){for(let t of e){let e=d(t);e&&_(e)}}const re=new FinalizationRegistry(t=>e().releaseNode(t)),v=/* @__PURE__ */ new WeakSet;function ie(e){return v.has(e)}function ae(e){v.add(e),re.register(e,e.__node_id)}const y=/* @__PURE__ */ new Map,b=/* @__PURE__ */ new Map,x=()=>globalThis.__inca_callbacks__??={};function oe(e,t,n,r){x()[n]=r;let i=y.get(e);i||y.set(e,i=/* @__PURE__ */ new Map),i.set(t,n),b.set(n,{group:e,listener:t})}function S(e,t){return y.get(e)?.get(t)}function C(e){delete x()[e];let t=b.get(e);if(t===void 0)return;b.delete(e);let n=y.get(t.group);n?.delete(t.listener),n?.size===0&&y.delete(t.group)}function se(e){for(let t of e)C(t)}const w=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{let n,r=!1;for(let e of t)try{se([e])}catch(e){r||(n=e),r=!0}if(ne(e),r)throw n},configurable:!0});let T=0;function ce(){return T}function le(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>T&&(T=n),e(...t)}}function E(t,n,r,i={}){if(r==null)return;let a=w(t,n,i.capture);if(S(a,r)!==void 0)return;let o=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),s=i.once?(...e)=>(D(t,n,r,i),o(...e)):o;oe(a,r,e().addEventListener(t,n,i.capture===!0,i.passive===!0),le(s))}function D(t,n,r,i={}){if(r==null)return;let a=S(w(t,n,i.capture),r);a!==void 0&&(e().removeEventListener(t,n,a),C(a))}function O(t,n){return e().dispatchEvent(t,n)}function k(t){e().click(t)}function A(t,n){e().focusNode(t,n)}function j(t){e().blurNode(t)}function ue(t,n){e().setPointerCapture(t,n)}function de(t,n){e().releasePointerCapture(t,n)}function fe(t,n){return e().hasPointerCapture(t,n)}function M(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};E(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;D(n(),e,t,{capture:i})},dispatchEvent:e=>O(n(),e)}}function N(){throw TypeError(`document cannot be constructed. use the document export of incajs`)}function pe(){throw TypeError(`a shadow root cannot be constructed. the host has no shadow roots`)}Object.defineProperty(globalThis,"Document",{value:N,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:pe,writable:!0,configurable:!0,enumerable:!1});function P(){return e().rootNodeId()}function me(t){return e().createNode(t)}function he(t,n){e().appendChild(t,n)}function ge(t,n,r){e().insertBefore(t,n,r)}function _e(t,n){e().removeChild(t,n)}function ve(t){se(e().releaseListeners(t))}function ye(t){e().holdNode(t)}function be(t){e().releaseNode(t)}function F(t,n,r){e().setAttribute(t,n,r)}function I(t,n){return e().getAttribute(t,n)}function xe(t){return e().attributeNames(t)}function Se(t,n){return e().matches(t,n)}function Ce(t,n){return e().closest(t,n)}function L(t){return e().layoutOf(t)}function R(t){return e().scrollOf(t)}function z(t,n,r){e().scrollNode(t,n,r)}function B(t,n,r){e().scrollIntoViewNode(t,n,r)}function V(t,n){e().removeAttribute(t,n)}function we(t,n,r){e().setStyle(t,n,r)}function Te(t,n){e().removeStyle(t,n)}function Ee(t){return e().inputValue(t)}function De(t,n){e().setInputValue(t,n)}function H(){return e().focusedNode()}function Oe(){let e=H();return e===null?null:d(e)??null}const U=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(a(M(`$document`,[`wheel`]),()=>!1),N.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:Oe}}),W=/* @__PURE__ */ Object.defineProperty(a(M(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`}),ke=/* @__PURE__ */ new Set([`\0`,` `,`
|
|
2
|
+
`,`\f`,`\r`,` `,`/`,`=`,`>`]);function Ae(e){if(e.length===0)return!1;for(let t of e)if(ke.has(t))return!1;return!0}function G(e){if(typeof e==`symbol`)throw TypeError(`a symbol cannot become text`);return String(e)}function K(e,t,n){if(e.length<t)throw TypeError(`${n}() needs ${t} argument${t===1?``:`s`}`)}function je(e,t){let n=t=>{let n=I(e,t);return n===null?null:G(n)},r=()=>g(t)?[]:xe(e);return{getAttribute:(...e)=>(K(e,1,`getAttribute`),g(t)?null:n(G(e[0]))),setAttribute:(...n)=>{K(n,2,`setAttribute`);let r=G(n[0]),i=G(n[1]);if(!Ae(r))throw new DOMException(`the attribute name is not valid. it is empty or holds whitespace, '/', '=' or '>'`,`InvalidCharacterError`);g(t)||F(e,r,i)},hasAttribute:(...e)=>(K(e,1,`hasAttribute`),!g(t)&&n(G(e[0]))!==null),removeAttribute:(...n)=>{K(n,1,`removeAttribute`);let r=G(n[0]);g(t)||V(e,r)},getAttributeNames:()=>r(),get attributes(){return r().map(e=>({name:e,value:n(e)??``}))}}}function q(e){return e.kind===`element`}function J(e){return e.children.filter(q)}function Y(e,t){let n=e.parent?.children??[];for(let r=n.indexOf(e)+t;r>=0&&r<n.length;r+=t){let e=n[r];if(q(e))return e}return null}function Me(e){return{get parentElement(){return e.parent},get firstElementChild(){return J(e)[0]??null},get lastElementChild(){return J(e).at(-1)??null},get childElementCount(){return J(e).length},get previousElementSibling(){return Y(e,-1)},get nextElementSibling(){return Y(e,1)}}}function X(e){return p(e)?null:L(e.__node_id)}function Z(e){let t=e.parent;return!X(e)||!t||!X(t)?null:t}function Q(e){let t=X(e);if(!t)return{left:0,top:0};let n=Z(e),r=n?X(n):null;return{left:Math.round(t[0]-(r?r[0]+r[4]:0)+t[5])||0,top:Math.round(t[1]-(r?r[1]+r[4]:0)+t[6])||0}}function Ne(e){let[t,n,r,i]=e??[0,0,0,0,0],a={x:t,y:n,width:r,height:i,top:n,left:t,right:t+r,bottom:n+i};return{...a,toJSON:()=>({...a})}}function Pe(e,t){let n=t===`button`||t===`input`?0:-1;if(typeof e!=`string`&&typeof e!=`number`)return n;let r=/^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));if(!r)return n;let i=Number(r[1])||0;return i>=-2147483648&&i<=2147483647?i:n}function $(e,t,n){if(p(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?R(e.__node_id)??[0,0]:[0,0],l=(e,t)=>{if(e===void 0)return null;let r=Number(e);return(n?t:0)+(Number.isFinite(r)?r:0)};z(e.__node_id,l(a,s),l(o,c))}function Fe(e){let t=[`start`,`center`,`end`,`nearest`];return typeof e==`object`&&e?{block:t.includes(e.block??``)?e.block:`start`,inline:t.includes(e.inline??``)?e.inline:`nearest`}:{block:e===!1?`end`:`start`,inline:`nearest`}}function Ie(e,t,n=`div`,r=[]){let i=M(()=>e,r),o=()=>p(u)?null:R(e),l={get id(){return g(u)?``:String(I(e,`id`)??``)},set id(t){g(u)||F(e,`id`,String(t))},kind:t,tagName:n.replace(/[a-z]/g,e=>e.toUpperCase()),parent:null,children:[],focus:t=>{p(u)||A(e,!!t?.preventScroll)},blur:()=>j(e),click:()=>{p(u)||k(e)},setPointerCapture:t=>ue(e,t),releasePointerCapture:t=>de(e,t),hasPointerCapture:t=>fe(e,t),contains:e=>{if(e==null)return!1;if(!c(e))throw TypeError(`the value is not a node. pass an element, a text node or null`);for(let t=e;t!==null;t=t.parent)if(t===u)return!0;return!1},addEventListener:(...e)=>{p(u)||i.addEventListener(...e)},removeEventListener:(...e)=>{p(u)||i.removeEventListener(...e)},dispatchEvent:e=>g(u)||i.dispatchEvent(e),get tabIndex(){return Pe(g(u)?null:I(e,`tabindex`),n)},set tabIndex(t){g(u)||F(e,`tabindex`,t|0)},getBoundingClientRect:()=>Ne(X(u)),get offsetWidth(){return Math.round(X(u)?.[2]??0)},get offsetHeight(){return Math.round(X(u)?.[3]??0)},get offsetLeft(){return Q(u).left},get offsetTop(){return Q(u).top},get offsetParent(){return Z(u)},get clientWidth(){let e=X(u);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=X(u);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(X(u)?.[4]??0)},get clientTop(){return Math.round(X(u)?.[4]??0)},get scrollLeft(){return o()?.[0]??0},set scrollLeft(e){$(u,[e],!1)},get scrollTop(){return o()?.[1]??0},set scrollTop(e){$(u,[void 0,e],!1)},get scrollWidth(){return u.clientWidth+Math.round(o()?.[2]??0)},get scrollHeight(){return u.clientHeight+Math.round(o()?.[3]??0)},scrollTo:(...e)=>$(u,e,!1),scrollBy:(...e)=>$(u,e,!0),scrollIntoView:t=>{if(p(u))return;let{block:n,inline:r}=Fe(t);B(e,n,r)},matches:(...t)=>(K(t,1,`matches`),!g(u)&&Se(e,G(t[0]))),closest:(...t)=>{if(K(t,1,`closest`),g(u))return null;let n=Ce(e,G(t[0]));if(n===null)return null;let r=u;for(;r!==null&&r.__node_id!==n;)r=r.parent;return r},getRootNode:()=>{let e=u;for(;e.parent!==null;)e=e.parent;return e.__node_id===P()?U:e}};n===`input`&&Object.defineProperty(l,"value",{get:()=>g(u)?``:Ee(e),set:t=>{g(u)||De(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let u=a(s(l,e),()=>p(u));return Object.defineProperties(u,Object.getOwnPropertyDescriptors(je(e,u))),Object.defineProperties(u,Object.getOwnPropertyDescriptors(Me(u))),t===`element`&&ee(u),u}function Le(){let e=P();return d(e)??Ie(e,`element`,void 0,[`wheel`])}Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?U:e===`$window`?W:d(e)??(e===P()?Le():null)),configurable:!0});export{D as A,M as C,O as D,k as E,ae as F,s as I,ie as M,p as N,A as O,m as P,we as S,j as T,P as _,he as a,R as b,I as c,L as d,ve as f,Te as g,_e as h,U as i,g as j,ce as k,ye as l,V as m,Le as n,me as o,be as p,W as r,H as s,Ie as t,ge as u,B as v,E as w,F as x,z as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,C as n,D as r,E as i,F as a,I as o,M as s,N as c,O as l,P as u,S as d,T as f,_ as p,a as m,b as h,c as g,d as _,f as v,g as y,h as b,j as x,k as S,l as C,m as w,n as T,o as E,p as D,r as O,s as k,t as A,u as j,v as M,w as N,x as P,y as F}from"./hooks-BbPHSiFF.js";function I(e){let t=E(e);return A(t,`element`,e)}function L(e){let t=E(`#text`);return P(t,`value`,e),o({kind:`text`,parent:null,text:e},t)}function R(){let e=E(`#comment`);return d(e,`display`,`none`),A(e,`comment`)}function z(e,t){P(e.__node_id,`value`,t),e.text=t}function B(e,t){for(let t of e.children.slice())W(t);if(!t)return;let n=L(t);m(e.__node_id,n.__node_id),n.parent=e,e.children.push(n)}function V(e){let t=e.parent;if(!t)return;let n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e.parent=null}function H(e){e.parent&&b(e.parent.__node_id,e.__node_id),V(e)}function U(e,t,n){if(n===e&&e.parent===t)return;H(e);let r=n?t.children.indexOf(n):-1;j(t.__node_id,e.__node_id,n&&r!==-1?n.__node_id:null),r===-1?t.children.push(e):t.children.splice(r,0,e),e.parent=t}function W(e){e.parent&&x(e.parent)?V(e):H(e),v(e.__node_id),u(e),e.kind===`element`&&!x(e)&&!s(e)&&(C(e.__node_id),a(e))}function G(e){return e.parent}function K(e){let t=e.parent;if(!t)return null;let n=t.children.indexOf(e);return t.children[n+1]??null}var q=/* @__PURE__ */ e({addEventListener:()=>N,appendChild:()=>m,blur:()=>f,click:()=>i,createCommentNode:()=>R,createElementNode:()=>I,createEventTarget:()=>n,createIncaElement:()=>A,createNode:()=>E,createTextNode:()=>L,dispatchEvent:()=>r,focus:()=>l,focusedNode:()=>k,getAttribute:()=>g,holdNode:()=>C,insert:()=>U,insertBefore:()=>j,isRemoved:()=>c,latestEventId:()=>S,layoutOf:()=>_,nextSibling:()=>K,parentNode:()=>G,releaseNode:()=>D,releaseWhenCollected:()=>a,remove:()=>W,removeAttribute:()=>w,removeChild:()=>b,removeEventListener:()=>t,removeStyle:()=>y,rootElement:()=>T,rootNodeId:()=>p,scrollIntoViewNode:()=>M,scrollNode:()=>F,scrollOf:()=>h,setAttribute:()=>P,setElementText:()=>B,setStyle:()=>d,setText:()=>z,window:()=>O});export{U as a,W as c,L as i,B as l,R as n,K as o,I as r,G as s,q as t,z as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as IncaElement, C as Overflow, D as TagName, E as StyleProps, M as IncaNode, N as IncaText, O as EventHandler, S as NodeId, T as ScrollAlignment, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as IncaInputElement, k as EventHandlers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./window-
|
|
1
|
+
import { A as IncaElement, C as Overflow, D as TagName, E as StyleProps, M as IncaNode, N as IncaText, O as EventHandler, S as NodeId, T as ScrollAlignment, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as IncaInputElement, k as EventHandlers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./window-VD8HXwVy.js";
|
|
2
2
|
/** What a listener or a dispatch names: a node id, or the tag of `document` or `window`. */
|
|
3
3
|
type EventTargetId = NodeId | "$document" | "$window";
|
|
4
4
|
/**
|
|
@@ -14,13 +14,16 @@ interface IncaNative {
|
|
|
14
14
|
setAttribute(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
15
15
|
getAttribute(nodeId: NodeId, key: string): AttributeValue | null;
|
|
16
16
|
removeAttribute(nodeId: NodeId, key: string): void;
|
|
17
|
+
attributeNames(nodeId: NodeId): string[];
|
|
18
|
+
matches(nodeId: NodeId, selector: string): boolean;
|
|
19
|
+
closest(nodeId: NodeId, selector: string): NodeId | null;
|
|
17
20
|
setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
|
|
18
21
|
removeStyle(nodeId: NodeId, key: string): void;
|
|
19
22
|
inputValue(nodeId: NodeId): string;
|
|
20
23
|
setInputValue(nodeId: NodeId, value: string): void;
|
|
21
24
|
addEventListener(target: EventTargetId, event: string, capture?: boolean, passive?: boolean): CallbackId;
|
|
22
25
|
removeEventListener(target: EventTargetId, event: string, callbackId: CallbackId): boolean;
|
|
23
|
-
|
|
26
|
+
releaseListeners(nodeId: NodeId): CallbackId[];
|
|
24
27
|
holdNode(nodeId: NodeId): void;
|
|
25
28
|
releaseNode(nodeId: NodeId): void;
|
|
26
29
|
focusNode(nodeId: NodeId, preventScroll?: boolean): void;
|
|
@@ -167,20 +170,11 @@ declare function insertBefore(parentId: NodeId, childId: NodeId, anchorId: NodeI
|
|
|
167
170
|
/**
|
|
168
171
|
* Detaches `childId` from `parentId`. The detached node keeps its own children
|
|
169
172
|
* and is freed at the start of the next frame unless it is inserted or held
|
|
170
|
-
* with {@link holdNode} by then.
|
|
173
|
+
* with {@link holdNode} by then.
|
|
171
174
|
* @param parentId - the current container
|
|
172
175
|
* @param childId - the node being detached
|
|
173
176
|
*/
|
|
174
177
|
declare function removeChild(parentId: NodeId, childId: NodeId): void;
|
|
175
|
-
/**
|
|
176
|
-
* Frees `nodeId` and its whole subtree, detaching it first, and drops every
|
|
177
|
-
* event listener registered anywhere in it. Destroying an already-destroyed
|
|
178
|
-
* node does nothing. The host's own root cannot be destroyed and raises.
|
|
179
|
-
*
|
|
180
|
-
* Also drops the hold of {@link holdNode}.
|
|
181
|
-
* @param nodeId - the node that isn't coming back
|
|
182
|
-
*/
|
|
183
|
-
declare function destroyNode(nodeId: NodeId): void;
|
|
184
178
|
/**
|
|
185
179
|
* Keeps `nodeId` and its subtree alive while it has no parent. The host frees
|
|
186
180
|
* a parentless node that is neither held nor inserted by the start of the next
|
|
@@ -295,7 +289,7 @@ declare function focusedNode(): NodeId | null;
|
|
|
295
289
|
* all driven through the host.
|
|
296
290
|
* @param id - the native node's id
|
|
297
291
|
* @param kind - whether the node is an element or a comment stand-in
|
|
298
|
-
* @param tag - the node's element kind,
|
|
292
|
+
* @param tag - the node's element kind, `div` when omitted; a `button` or `input` defaults to tab
|
|
299
293
|
* index `0`, and an `input` has `value`
|
|
300
294
|
* @param passiveByDefault - event names whose listeners are passive unless their options say
|
|
301
295
|
* `passive: false`
|
|
@@ -310,11 +304,12 @@ declare function createIncaElement(id: NodeId, kind: IncaElement["kind"], tag?:
|
|
|
310
304
|
*/
|
|
311
305
|
declare function rootElement(): IncaElement;
|
|
312
306
|
/**
|
|
313
|
-
* Whether the
|
|
307
|
+
* Whether `node` left the tree for good, removed or freed. A removed node stays in the host and
|
|
308
|
+
* its members read real values. Its listeners are gone.
|
|
314
309
|
* @param node - the handle to check
|
|
315
|
-
* @returns `true` after {@link markDestroyed} reached `node`
|
|
310
|
+
* @returns `true` after {@link markRemoved} or {@link markDestroyed} reached `node`
|
|
316
311
|
*/
|
|
317
|
-
declare function
|
|
312
|
+
declare function isRemoved(node: IncaNode): boolean;
|
|
318
313
|
/**
|
|
319
314
|
* Allocates a new element node for `tag`.
|
|
320
315
|
* @param tag - the node's element kind
|
|
@@ -357,11 +352,11 @@ declare function setElementText(el: IncaElement, text: string): void;
|
|
|
357
352
|
*/
|
|
358
353
|
declare function insert(child: IncaNode, parent: IncaElement, anchor?: IncaNode | null): void;
|
|
359
354
|
/**
|
|
360
|
-
* Removes `child` for good: the native node
|
|
361
|
-
* event listener registered in
|
|
355
|
+
* Removes `child` for good: the native node leaves its parent and keeps its
|
|
356
|
+
* subtree, and every event listener registered in the subtree is released. The
|
|
357
|
+
* handles stay readable: the root is held until its handle is collected.
|
|
362
358
|
*
|
|
363
|
-
* A caller that removes a subtree calls this on its root alone
|
|
364
|
-
* frees the descendants with it.
|
|
359
|
+
* A caller that removes a subtree calls this on its root alone.
|
|
365
360
|
* @param child - the node being removed
|
|
366
361
|
*/
|
|
367
362
|
declare function remove(child: IncaNode): void;
|
|
@@ -378,11 +373,11 @@ declare function parentNode(node: IncaNode): IncaElement | null;
|
|
|
378
373
|
*/
|
|
379
374
|
declare function nextSibling(node: IncaNode): IncaNode | null;
|
|
380
375
|
declare namespace rendererCore_d_exports {
|
|
381
|
-
export { AttributeValue, CallbackId, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaPointerEvent, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NodeId, Overflow, Px, ScrollAlignment, StyleProps, TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode,
|
|
376
|
+
export { AttributeValue, CallbackId, EventHandler, EventHandlers, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaCompositionEvent, IncaCore, IncaDocument, IncaElement, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaInputElement, IncaInputEvent, IncaKeyboardEvent, IncaMouseEvent, IncaNode, IncaPointerEvent, IncaText, IncaUIEvent, IncaWheelEvent, IncaWindow, ListenerOptions, NodeId, Overflow, Px, ScrollAlignment, StyleProps, TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
|
382
377
|
}
|
|
383
378
|
/**
|
|
384
379
|
* What a custom renderer (`incajs/vue`) drives the host through: the tree and
|
|
385
380
|
* event calls, the element handles and the shadow tree.
|
|
386
381
|
*/
|
|
387
382
|
type IncaCore = typeof rendererCore_d_exports;
|
|
388
|
-
export {
|
|
383
|
+
export { setStyle as A, removeChild as C, scrollNode as D, scrollIntoViewNode as E, focus as F, latestEventId as I, removeEventListener as L, blur as M, click as N, scrollOf as O, dispatchEvent as P, createEventTarget as R, removeAttribute as S, rootNodeId as T, getAttribute as _, insert as a, layoutOf as b, remove as c, isRemoved as d, createIncaElement as f, focusedNode as g, createNode as h, createTextNode as i, addEventListener as j, setAttribute as k, setElementText as l, appendChild as m, createCommentNode as n, nextSibling as o, rootElement as p, createElementNode as r, parentNode as s, IncaCore as t, setText as u, holdNode as v, removeStyle as w, releaseNode as x, insertBefore as y };
|
|
@@ -5,7 +5,7 @@ declare global {
|
|
|
5
5
|
function clearInterval(id?: number): void;
|
|
6
6
|
}
|
|
7
7
|
/** The events whose handler property every element has. */
|
|
8
|
-
declare const HANDLER_EVENTS: readonly ["auxclick", "beforeinput", "blur", "change", "click", "contextmenu", "dblclick", "focus", "gotpointercapture", "input", "keydown", "keyup", "lostpointercapture", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointerenter", "pointerleave", "pointermove", "pointerout", "pointerover", "pointerup", "scroll", "wheel"];
|
|
8
|
+
declare const HANDLER_EVENTS: readonly ["auxclick", "beforeinput", "blur", "change", "click", "contextmenu", "dblclick", "focus", "gotpointercapture", "input", "keydown", "keypress", "keyup", "lostpointercapture", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointerenter", "pointerleave", "pointermove", "pointerout", "pointerover", "pointerup", "scroll", "wheel"];
|
|
9
9
|
/** The plain values of a {@link RectLike}, as `toJSON` returns them. */
|
|
10
10
|
interface RectValues {
|
|
11
11
|
readonly x: number;
|
|
@@ -55,15 +55,15 @@ type EventHandlers<T = IncaElement> = { [K in (typeof HANDLER_EVENTS)[number] as
|
|
|
55
55
|
* parent. `parent` and `children` read the node's current position in the
|
|
56
56
|
* tree.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `dispatchEvent()`
|
|
58
|
+
* A removed node keeps its attributes and its position in its own subtree, and its members read
|
|
59
|
+
* them. Its listeners are dropped. `addEventListener()` and `removeEventListener()` ignore the
|
|
60
|
+
* call, an assignment to a handler property does nothing, and `dispatchEvent()` runs no listener
|
|
61
|
+
* on it.
|
|
61
62
|
*/
|
|
62
63
|
interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
63
64
|
/**
|
|
64
65
|
* The `id` attribute, or an empty string when it is unset. Assigning sets
|
|
65
|
-
* the attribute to the value as a string.
|
|
66
|
-
* reading gives an empty string and assigning does nothing.
|
|
66
|
+
* the attribute to the value as a string.
|
|
67
67
|
*/
|
|
68
68
|
id: string;
|
|
69
69
|
/**
|
|
@@ -71,10 +71,27 @@ interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
|
71
71
|
* `"element"` for every other container.
|
|
72
72
|
*/
|
|
73
73
|
readonly kind: "element" | "comment";
|
|
74
|
+
/**
|
|
75
|
+
* The tag of the element in ASCII upper case, such as `"BUTTON"`. The mount container reads
|
|
76
|
+
* `"DIV"`.
|
|
77
|
+
*/
|
|
78
|
+
readonly tagName: string;
|
|
74
79
|
/** The current parent, or `null` if this node isn't attached to the tree. */
|
|
75
80
|
parent: IncaElement | null;
|
|
76
81
|
/** This node's children, in render order. */
|
|
77
82
|
children: IncaNode[];
|
|
83
|
+
/** The parent element, or `null` for a detached node and for the mount container. */
|
|
84
|
+
readonly parentElement: IncaElement | null;
|
|
85
|
+
/** The first child that is an element, or `null`. */
|
|
86
|
+
readonly firstElementChild: IncaElement | null;
|
|
87
|
+
/** The last child that is an element, or `null`. */
|
|
88
|
+
readonly lastElementChild: IncaElement | null;
|
|
89
|
+
/** The number of children that are elements. */
|
|
90
|
+
readonly childElementCount: number;
|
|
91
|
+
/** The closest earlier sibling that is an element, or `null`. */
|
|
92
|
+
readonly previousElementSibling: IncaElement | null;
|
|
93
|
+
/** The closest later sibling that is an element, or `null`. */
|
|
94
|
+
readonly nextElementSibling: IncaElement | null;
|
|
78
95
|
/**
|
|
79
96
|
* Focuses this node next frame. The node needs a `tabindex` attribute. A
|
|
80
97
|
* `true` `preventScroll` keeps every scroll container where it is. After
|
|
@@ -119,10 +136,60 @@ interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
|
119
136
|
* Assigning sets the `tabindex` attribute to the value's integer part,
|
|
120
137
|
* wrapped to 32 bits. Reading returns the `tabindex` attribute as an
|
|
121
138
|
* integer, or `-1` (`0` for a `button` or an `input`) when it is unset or invalid.
|
|
122
|
-
* After the node is removed, reading gives that default and assigning does
|
|
123
|
-
* nothing.
|
|
124
139
|
*/
|
|
125
140
|
tabIndex: number;
|
|
141
|
+
/**
|
|
142
|
+
* The value of the attribute `name` as a string, or `null` when it is unset. Names are
|
|
143
|
+
* ASCII-case-insensitive.
|
|
144
|
+
* @param name - The attribute name.
|
|
145
|
+
* @returns The attribute value, or `null` when the attribute is unset.
|
|
146
|
+
*/
|
|
147
|
+
getAttribute(name: string): string | null;
|
|
148
|
+
/**
|
|
149
|
+
* Sets the attribute `name` to `String(value)`. Names are ASCII-case-insensitive.
|
|
150
|
+
* `disabled`, `hidden`, `inert` and `readonly` take effect by presence.
|
|
151
|
+
* @throws DOMException named `InvalidCharacterError` for an empty name, or one that holds ASCII
|
|
152
|
+
* whitespace, NUL, `/`, `=` or `>`
|
|
153
|
+
* @param name - The attribute name.
|
|
154
|
+
* @param value - The new value, converted with `String`.
|
|
155
|
+
*/
|
|
156
|
+
setAttribute(name: string, value: string): void;
|
|
157
|
+
/**
|
|
158
|
+
* Whether the attribute `name` is set, an empty value included.
|
|
159
|
+
* @param name - The attribute name.
|
|
160
|
+
* @returns `true` when the attribute is set.
|
|
161
|
+
*/
|
|
162
|
+
hasAttribute(name: string): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Removes the attribute `name`. An unset name changes nothing.
|
|
165
|
+
* @param name - The attribute name.
|
|
166
|
+
*/
|
|
167
|
+
removeAttribute(name: string): void;
|
|
168
|
+
/** The names of the set attributes in alphabetical order. */
|
|
169
|
+
getAttributeNames(): string[];
|
|
170
|
+
/**
|
|
171
|
+
* The set attributes as `{ name, value }` objects in alphabetical order of the name. Each read
|
|
172
|
+
* builds a new array, so a later change does not reach an earlier one.
|
|
173
|
+
*/
|
|
174
|
+
readonly attributes: readonly {
|
|
175
|
+
name: string;
|
|
176
|
+
value: string;
|
|
177
|
+
}[];
|
|
178
|
+
/**
|
|
179
|
+
* Whether this element matches the selector list. `:hover`, `:focus` and the other interactive
|
|
180
|
+
* and form-state pseudo-classes never match.
|
|
181
|
+
* @throws DOMException named `SyntaxError` for an invalid selector
|
|
182
|
+
* @param selectors - A selector list.
|
|
183
|
+
* @returns `true` when this element matches the selector list.
|
|
184
|
+
*/
|
|
185
|
+
matches(selectors: string): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* The nearest element at or above this one that matches the selector list, or `null`.
|
|
188
|
+
* @throws DOMException named `SyntaxError` for an invalid selector
|
|
189
|
+
* @param selectors - A selector list.
|
|
190
|
+
* @returns The matching element, or `null` when none matches.
|
|
191
|
+
*/
|
|
192
|
+
closest(selectors: string): IncaElement | null;
|
|
126
193
|
/**
|
|
127
194
|
* The box this node was drawn at in the last frame, in window logical
|
|
128
195
|
* pixels. A node created in the same task reads all zeros.
|
|
@@ -181,8 +248,7 @@ interface IncaElement extends IncaEventTarget, EventHandlers {
|
|
|
181
248
|
interface IncaInputElement extends IncaElement {
|
|
182
249
|
/**
|
|
183
250
|
* The text of the input. Assigning sets the value as a string, and `null` as `""`; line breaks
|
|
184
|
-
* are dropped and a changed text puts the caret at its end.
|
|
185
|
-
* gives `""` and assigning does nothing.
|
|
251
|
+
* are dropped and a changed text puts the caret at its end.
|
|
186
252
|
*/
|
|
187
253
|
value: string;
|
|
188
254
|
}
|
|
@@ -206,7 +272,7 @@ type IncaNode = IncaElement | IncaText;
|
|
|
206
272
|
type NodeId = number;
|
|
207
273
|
/**
|
|
208
274
|
* Id assigned to one registered event listener. Managed internally by
|
|
209
|
-
* `addEventListener`/`removeEventListener`/`
|
|
275
|
+
* `addEventListener`/`removeEventListener`/`releaseListeners`.
|
|
210
276
|
*/
|
|
211
277
|
type CallbackId = number;
|
|
212
278
|
/**
|
|
@@ -214,14 +280,8 @@ type CallbackId = number;
|
|
|
214
280
|
* exception.
|
|
215
281
|
*/
|
|
216
282
|
type AttributeValue = string | number | boolean;
|
|
217
|
-
/**
|
|
218
|
-
|
|
219
|
-
* dedicated rendering behavior: it renders its `"value"` attribute followed
|
|
220
|
-
* by its descendants' text. Any other string is a generic styled
|
|
221
|
-
* container; the `string & {}` half of this type keeps `"text"`'s
|
|
222
|
-
* autocomplete while still accepting an arbitrary tag name.
|
|
223
|
-
*/
|
|
224
|
-
type TagName = "text" | (string & {});
|
|
283
|
+
/** Element kind passed to `createNode`. */
|
|
284
|
+
type TagName = string;
|
|
225
285
|
/** Where `scrollIntoView` aligns a node on one axis. */
|
|
226
286
|
type ScrollAlignment = "start" | "center" | "end" | "nearest";
|
|
227
287
|
/** One overflow value; `"auto"` is an alias of `"scroll"`. */
|
|
@@ -256,11 +316,18 @@ interface StyleProps {
|
|
|
256
316
|
height?: Px | "auto";
|
|
257
317
|
/** Uniform border width in px (`>= 0`), applied to all four sides. */
|
|
258
318
|
borderWidth?: Px;
|
|
259
|
-
/**
|
|
319
|
+
/**
|
|
320
|
+
* Fill color, as a hex number (`0xRRGGBB`) or a color string: `"#rgb"`, `"#rgba"`, `"#rrggbb"`,
|
|
321
|
+
* `"#rrggbbaa"`, `"transparent"`, `"rgb()"` or `"rgba()"`.
|
|
322
|
+
*/
|
|
260
323
|
backgroundColor?: number | string;
|
|
261
324
|
/** Border color. Accepts the same formats as {@link StyleProps.backgroundColor}. */
|
|
262
325
|
borderColor?: number | string;
|
|
263
|
-
/**
|
|
326
|
+
/**
|
|
327
|
+
* Color for this container's own text. Accepts the same formats as
|
|
328
|
+
* {@link StyleProps.backgroundColor}. Cascades to descendant text leaves, same as
|
|
329
|
+
* {@link StyleProps.fontSize}; there's no separate per-leaf text styling.
|
|
330
|
+
*/
|
|
264
331
|
color?: number | string;
|
|
265
332
|
/** Uniform corner radius in px (`>= 0`), applied to all four corners. */
|
|
266
333
|
borderRadius?: Px;
|
|
@@ -378,7 +445,10 @@ interface IncaEventTarget {
|
|
|
378
445
|
* The event target between the elements and `window`.
|
|
379
446
|
*/
|
|
380
447
|
interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument> {
|
|
381
|
-
/**
|
|
448
|
+
/**
|
|
449
|
+
* The element that has focus, or `null` when no element has focus. A `focus()` or `blur()` call
|
|
450
|
+
* takes effect for this property at once.
|
|
451
|
+
*/
|
|
382
452
|
readonly activeElement: IncaElement | null;
|
|
383
453
|
}
|
|
384
454
|
/**
|
|
@@ -576,7 +646,7 @@ interface IncaWheelEvent extends IncaMouseEvent {
|
|
|
576
646
|
readonly DOM_DELTA_LINE: 1;
|
|
577
647
|
readonly DOM_DELTA_PAGE: 2;
|
|
578
648
|
}
|
|
579
|
-
/** The event object of `keydown` and `keyup`. */
|
|
649
|
+
/** The event object of `keydown`, `keypress` and `keyup`. */
|
|
580
650
|
interface IncaKeyboardEvent extends IncaUIEvent {
|
|
581
651
|
/** The key's name, such as `"Enter"`, `"F5"` or the typed character. */
|
|
582
652
|
readonly key: string;
|
|
@@ -588,9 +658,12 @@ interface IncaKeyboardEvent extends IncaUIEvent {
|
|
|
588
658
|
readonly repeat: boolean;
|
|
589
659
|
/** Whether an input method composes in the focused `<input>`. */
|
|
590
660
|
readonly isComposing: boolean;
|
|
591
|
-
/**
|
|
661
|
+
/**
|
|
662
|
+
* The key's code on a US keyboard layout, and `0` for a key outside it. On `keypress` it is the
|
|
663
|
+
* `charCode`.
|
|
664
|
+
*/
|
|
592
665
|
readonly keyCode: number;
|
|
593
|
-
/** `0` on
|
|
666
|
+
/** The code of the typed character on `keypress`, and `0` on `keydown` and `keyup`. */
|
|
594
667
|
readonly charCode: number;
|
|
595
668
|
readonly ctrlKey: boolean;
|
|
596
669
|
readonly shiftKey: boolean;
|
|
@@ -650,6 +723,7 @@ interface IncaEventMap {
|
|
|
650
723
|
gotpointercapture: IncaPointerEvent;
|
|
651
724
|
input: IncaInputEvent;
|
|
652
725
|
keydown: IncaKeyboardEvent;
|
|
726
|
+
keypress: IncaKeyboardEvent;
|
|
653
727
|
keyup: IncaKeyboardEvent;
|
|
654
728
|
lostpointercapture: IncaPointerEvent;
|
|
655
729
|
mousedown: IncaMouseEvent;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as IncaElement, D as TagName, E as StyleProps, F as ScrollOptions, I as RectLike, L as RectValues, M as IncaNode, P as ScrollIntoViewOptions, S as NodeId, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as IncaInputElement, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-
|
|
1
|
+
import { A as IncaElement, D as TagName, E as StyleProps, F as ScrollOptions, I as RectLike, L as RectValues, M as IncaNode, P as ScrollIntoViewOptions, S as NodeId, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as IncaInputElement, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-VD8HXwVy.js";
|
|
2
2
|
/**
|
|
3
3
|
* The event target between the elements and `window`. An event at an element
|
|
4
4
|
* passes through it, and it is the next target after the mount container.
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{i as document,r as window}from"./chunks/hooks-
|
|
1
|
+
export{i as document,r as window}from"./chunks/hooks-BbPHSiFF.js";
|
package/dist/rendererCore.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as IncaElement, C as Overflow, D as TagName, E as StyleProps, M as IncaNode, N as IncaText, O as EventHandler, S as NodeId, T as ScrollAlignment, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as IncaInputElement, k as EventHandlers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-
|
|
2
|
-
import { A as
|
|
3
|
-
export { type AttributeValue, type CallbackId, type EventHandler, type EventHandlers, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type IncaCompositionEvent, IncaCore, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaPointerEvent, type IncaText, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NodeId, type Overflow, type Px, type ScrollAlignment, type StyleProps, type TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode,
|
|
1
|
+
import { A as IncaElement, C as Overflow, D as TagName, E as StyleProps, M as IncaNode, N as IncaText, O as EventHandler, S as NodeId, T as ScrollAlignment, _ as IncaPointerEvent, a as EventListener, b as IncaWindow, c as IncaCompositionEvent, d as IncaEventMap, f as IncaEventTarget, g as IncaMouseEvent, h as IncaKeyboardEvent, i as EventLike, j as IncaInputElement, k as EventHandlers, l as IncaDocument, m as IncaInputEvent, n as AttributeValue, o as EventListenerObject, p as IncaFocusEvent, r as CallbackId, s as EventListenerOrObject, t as window, u as IncaEvent, v as IncaUIEvent, w as Px, x as ListenerOptions, y as IncaWheelEvent } from "./chunks/window-VD8HXwVy.js";
|
|
2
|
+
import { A as setStyle, C as removeChild, D as scrollNode, E as scrollIntoViewNode, F as focus, I as latestEventId, L as removeEventListener, M as blur, N as click, O as scrollOf, P as dispatchEvent, R as createEventTarget, S as removeAttribute, T as rootNodeId, _ as getAttribute, a as insert, b as layoutOf, c as remove, d as isRemoved, f as createIncaElement, g as focusedNode, h as createNode, i as createTextNode, j as addEventListener, k as setAttribute, l as setElementText, m as appendChild, n as createCommentNode, o as nextSibling, p as rootElement, r as createElementNode, s as parentNode, t as IncaCore, u as setText, v as holdNode, w as removeStyle, x as releaseNode, y as insertBefore } from "./chunks/rendererCore-oCllOmUF.js";
|
|
3
|
+
export { type AttributeValue, type CallbackId, type EventHandler, type EventHandlers, type EventLike, type EventListener, type EventListenerObject, type EventListenerOrObject, type IncaCompositionEvent, IncaCore, type IncaDocument, type IncaElement, type IncaEvent, type IncaEventMap, type IncaEventTarget, type IncaFocusEvent, type IncaInputElement, type IncaInputEvent, type IncaKeyboardEvent, type IncaMouseEvent, type IncaNode, type IncaPointerEvent, type IncaText, type IncaUIEvent, type IncaWheelEvent, type IncaWindow, type ListenerOptions, type NodeId, type Overflow, type Px, type ScrollAlignment, type StyleProps, type TagName, addEventListener, appendChild, blur, click, createCommentNode, createElementNode, createEventTarget, createIncaElement, createNode, createTextNode, dispatchEvent, focus, focusedNode, getAttribute, holdNode, insert, insertBefore, isRemoved, latestEventId, layoutOf, nextSibling, parentNode, releaseNode, remove, removeAttribute, removeChild, removeEventListener, removeStyle, rootElement, rootNodeId, scrollIntoViewNode, scrollNode, scrollOf, setAttribute, setElementText, setStyle, setText, window };
|
package/dist/rendererCore.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,C as t,D as n,E as r,
|
|
1
|
+
import{A as e,C as t,D as n,E as r,F as i,N as a,O as o,S as s,T as c,_ as l,a as u,b as d,c as f,d as p,g as m,h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"./chunks/hooks-BbPHSiFF.js";import{a as A,c as j,i as M,l as N,n as P,o as F,r as I,s as L,u as R}from"./chunks/rendererCore-BaVb8wQu.js";export{D as addEventListener,u as appendChild,c as blur,r as click,P as createCommentNode,I as createElementNode,t as createEventTarget,w as createIncaElement,b as createNode,M as createTextNode,n as dispatchEvent,o as focus,C as focusedNode,f as getAttribute,_ as holdNode,A as insert,T as insertBefore,a as isRemoved,g as latestEventId,p as layoutOf,F as nextSibling,L as parentNode,x as releaseNode,i as releaseWhenCollected,j as remove,v as removeAttribute,h as removeChild,e as removeEventListener,m as removeStyle,y as rootElement,l as rootNodeId,E as scrollIntoViewNode,k as scrollNode,d as scrollOf,O as setAttribute,N as setElementText,s as setStyle,R as setText,S as window};
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as IncaElement } from "./chunks/window-
|
|
2
|
-
import "./chunks/rendererCore-
|
|
1
|
+
import { A as IncaElement } from "./chunks/window-VD8HXwVy.js";
|
|
2
|
+
import "./chunks/rendererCore-oCllOmUF.js";
|
|
3
3
|
import { App, Component, ComponentPublicInstance } from "@vue/runtime-core";
|
|
4
4
|
/**
|
|
5
5
|
* `@vue/runtime-core`'s `App`, with `mount` also callable with no argument
|
package/dist/vue.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunks/hooks-
|
|
2
|
-
Expected function or array of functions, received type ${typeof e}.`),[]):null}function y(e,t){let n=e[0];if(typeof n!=`object`||!n)return t(()=>!1);let r=n.stopImmediatePropagation;if(typeof r!=`function`)return t(()=>!1);let i=Object.hasOwn(n,`stopImmediatePropagation`),a=!1;try{n.stopImmediatePropagation=(...e)=>(a=!0,r.apply(n,e))}catch{return t(()=>!1)}try{t(()=>a)}finally{i?n.stopImmediatePropagation=r:delete n.stopImmediatePropagation}}const b=/* @__PURE__ */ new WeakMap,x=({event:e,capture:t,passive:n})=>`${e}:${t===!0}:${n===!0}`;function S(e,t,n,r){let i=Array.from(r.slots.values()).some(e=>!e.fired);i&&!r.registered&&!e.
|
|
1
|
+
import{n as e}from"./chunks/hooks-BbPHSiFF.js";import{t}from"./chunks/rendererCore-BaVb8wQu.js";import{ErrorCodes as n,callWithAsyncErrorHandling as r,createRenderer as i,warn as a}from"@vue/runtime-core";function o(e){return Object.defineProperty(e,"__v_skip",{value:!0}),e}function s(e){return{createElement:t=>o(e.createElementNode(t)),createText:t=>o(e.createTextNode(t)),createComment:t=>o(e.createCommentNode()),setText:(t,n)=>e.setText(t,n),setElementText:(t,n)=>e.setElementText(t,n),insert:(t,n,r)=>e.insert(t,n,r),remove:t=>e.remove(t),parentNode:e.parentNode,nextSibling:e.nextSibling}}function c(e,t){let n=t=>(e.holdNode(t.__node_id),e.releaseWhenCollected(t),t),{createElement:r,createText:i}=t;return{createElement:e=>n(r(e)),createText:e=>n(i(e))}}const l=e=>/^on[^a-z]/.test(e),u=e=>/^on[a-z]/.test(e),d=/(?:Once|Passive|Capture)$/,f=/^on:?(?:Once|Passive|Capture)$/,p=e=>e.replace(/\B([A-Z])/g,`-$1`).toLowerCase();function m(e){let t=e,n={event:``,once:!1,capture:!1,passive:!1},r;for(;(r=t.match(d))&&!f.test(t);)t=t.slice(0,-r[0].length),r[0]===`Once`?n.once=!0:r[0]===`Capture`?n.capture=!0:n.passive=!0;return n.event=t[2]===`:`?t.slice(3):p(t.slice(2)),n}const h=e=>typeof e==`string`||typeof e==`number`,g=/* @__PURE__ */ new WeakMap;function _(e,t,n){let r=typeof n==`object`&&n?n:{},i=g.get(t);i||g.set(t,i=/* @__PURE__ */ new Map);let a=!1;for(let n of i.keys())h(r[n])||(e.removeStyle(t.__node_id,n),i.delete(n),a=!0);for(let[n,o]of Object.entries(r))h(o)&&(a||i.get(n)!==o)&&(e.setStyle(t.__node_id,n,o),i.set(n,o))}function v(e,t){return e?typeof e==`function`?[e]:Array.isArray(e)?e.slice():(a(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
2
|
+
Expected function or array of functions, received type ${typeof e}.`),[]):null}function y(e,t){let n=e[0];if(typeof n!=`object`||!n)return t(()=>!1);let r=n.stopImmediatePropagation;if(typeof r!=`function`)return t(()=>!1);let i=Object.hasOwn(n,`stopImmediatePropagation`),a=!1;try{n.stopImmediatePropagation=(...e)=>(a=!0,r.apply(n,e))}catch{return t(()=>!1)}try{t(()=>a)}finally{i?n.stopImmediatePropagation=r:delete n.stopImmediatePropagation}}const b=/* @__PURE__ */ new WeakMap,x=({event:e,capture:t,passive:n})=>`${e}:${t===!0}:${n===!0}`;function S(e,t,n,r){let i=Array.from(r.slots.values()).some(e=>!e.fired);i&&!r.registered&&!e.isRemoved(t)?(e.addEventListener(t.__node_id,r.event,r.dispatcher,r.options),r.registered=!0):!i&&r.registered&&(r.registered=!1,e.removeEventListener(t.__node_id,r.event,r.dispatcher,r.options)),r.slots.size===0&&b.get(t)?.delete(n)}function C(e,t,i,{event:a,capture:o,passive:s}){let c={event:a,options:{capture:o,passive:s},slots:/* @__PURE__ */ new Map,registered:!1,dispatcher:(...a)=>{let o=[],s=a[0]?.eventId;y(a,l=>{for(let u of Array.from(c.slots.keys())){if(l())break;let d=c.slots.get(u);if(d&&!d.fired&&!(typeof s==`number`&&d.attachedAt>=s)){d.once&&(d.fired=!0,S(e,t,i,c));for(let e of d.handlers){if(l())break;if(e)try{r(e,d.instance,n.NATIVE_EVENT_HANDLER,a)}catch(e){o.push(e)}}}}});for(let e of o.slice(1))Promise.reject(e);if(o.length>0)throw o[0]}};return c}function w(e,t,n,r){let i=x(n),a=b.get(t)?.get(i);a?.slots.delete(r)&&S(e,t,i,a)}function T(e,t,n,r,i){let a=m(n),o=v(r,n);if(!o){w(e,t,a,n);return}let s=x(a),c=b.get(t);c||b.set(t,c=/* @__PURE__ */ new Map);let l=c.get(s);l||c.set(s,l=C(e,t,s,a));let u=l.slots.get(n);if(u)u.handlers=o,u.instance=i;else{l.slots.set(n,{attachedAt:e.latestEventId(),handlers:o,instance:i,once:a.once,fired:!1});try{S(e,t,s,l)}catch(e){throw l.slots.delete(n),l.slots.size===0&&c.delete(s),e}}}const E=/* @__PURE__ */ new Set([`disabled`,`hidden`,`inert`,`allowfullscreen`,`formnovalidate`,`ismap`,`itemscope`,`nomodule`,`novalidate`,`readonly`]);function D(e){return(t,n,r,i,a,o)=>{n.startsWith(`onUpdate:`)||(n===`style`?_(e,t,i):l(n)?T(e,t,n,i,o??null):u(n)&&n in t?typeof i==`string`?(Reflect.set(t,n,null),e.setAttribute(t.__node_id,n,i)):Reflect.set(t,n,i):n===`value`&&`value`in t?Reflect.set(t,n,i??``):E.has(n)?n===`hidden`&&typeof i==`string`&&/^until-found$/i.test(i)?e.setAttribute(t.__node_id,n,i):i||i===``?e.setAttribute(t.__node_id,n,``):e.removeAttribute(t.__node_id,n):typeof i==`string`||typeof i==`number`||typeof i==`boolean`?e.setAttribute(t.__node_id,n,i):i==null?e.removeAttribute(t.__node_id,n):e.setAttribute(t.__node_id,n,String(i)))}}const O=/* @__PURE__ */ new Set;function k(n,r){let a={...s(t),patchProp:D(t)},l=i(a);Object.assign(a,c(t,a));let u=l.createApp(n,r),d=u.mount.bind(u),f=u.unmount.bind(u);return Object.assign(u,{mount:t=>{let n=d(t??o(e()));return O.add(u),n},unmount:()=>{f(),O.delete(u)}})}export{k as createIncaApp};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incajs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"description": "A GPU-native, Webview-free desktop app framework built on GPUI and QuickJS.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-platform",
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
"directory": "packages/core"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist"
|
|
30
|
+
"dist",
|
|
31
|
+
"LICENSE-MIT",
|
|
32
|
+
"LICENSE-APACHE"
|
|
31
33
|
],
|
|
32
34
|
"type": "module",
|
|
33
35
|
"sideEffects": [
|
package/LICENSE
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return globalThis.__inca_native__}const t=/* @__PURE__ */ new Map;function n(n,r,i,a,o){if(typeof r!=`function`)throw TypeError(`${n} takes a function. pass a function as the handler`);let s=i|0,c=e().startTimer(s>0?s:0,o);if(c===void 0)throw RangeError(`timer ids are exhausted. restart the app`);return t.set(c,{handler:r,args:a,repeat:o}),c}function r(n){let r=n|0;t.delete(r)&&e().stopTimer(r)}Object.defineProperty(globalThis,"__inca_timer__",{value:n=>{let r=t.get(n);r===void 0?e().stopTimer(n):(r.repeat||t.delete(n),Reflect.apply(r.handler,globalThis,r.args))},configurable:!0}),typeof globalThis.__inca_native__?.startTimer==`function`&&Object.assign(globalThis,{setTimeout(e,t=0,...r){return n(`setTimeout`,e,t,r,!1)},setInterval(e,t=0,...r){return n(`setInterval`,e,t,r,!0)},clearTimeout(e=0){r(e)},clearInterval(e=0){r(e)}});const i=/* @__PURE__ */ `auxclick.beforeinput.blur.change.click.contextmenu.dblclick.focus.gotpointercapture.input.keydown.keyup.lostpointercapture.mousedown.mouseenter.mouseleave.mousemove.mouseout.mouseover.mouseup.pointerdown.pointerenter.pointerleave.pointermove.pointerout.pointerover.pointerup.scroll.wheel`.split(`.`);function a(e,t){for(let n of i){let r=null,i=function(e){typeof r==`function`&&Reflect.apply(r,this,[e])===!1&&e.preventDefault()};Object.defineProperty(e,`on${n}`,{get:()=>r,set(a){t()||(r=typeof a==`function`||typeof a==`object`&&a?a:null,r===null?e.removeEventListener(n,i):e.addEventListener(n,i))}})}return e}const o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=()=>globalThis.__inca_callbacks__??={};function l(e,t,n,r){c()[n]=r;let i=o.get(e);i||o.set(e,i=/* @__PURE__ */ new Map),i.set(t,n),s.set(n,{group:e,listener:t})}function u(e,t){return o.get(e)?.get(t)}function d(e){delete c()[e];let t=s.get(e);if(t===void 0)return;s.delete(e);let n=o.get(t.group);n?.delete(t.listener),n?.size===0&&o.delete(t.group)}function f(e){for(let t of e)d(t)}const p=(e,t,n)=>`${e}:${t}:${n===!0}`;Object.defineProperty(globalThis,"__inca_released__",{value:(e,t)=>{let n,r=!1;for(let e of t)try{f([e])}catch(e){r||(n=e),r=!0}if(pe(e),r)throw n},configurable:!0});function m(){return e().rootNodeId()}function ee(t){return e().createNode(t)}function te(t,n){e().appendChild(t,n)}function ne(t,n,r){e().insertBefore(t,n,r)}function re(t,n){e().removeChild(t,n)}function ie(t){f(e().destroyNode(t))}function ae(t){e().holdNode(t)}function oe(t){e().releaseNode(t)}function h(t,n,r){e().setAttribute(t,n,r)}function g(t,n){return e().getAttribute(t,n)}function _(t){return e().layoutOf(t)}function v(t){return e().scrollOf(t)}function y(t,n,r){e().scrollNode(t,n,r)}function b(t,n,r){e().scrollIntoViewNode(t,n,r)}function se(t,n){e().removeAttribute(t,n)}function x(t,n,r){e().setStyle(t,n,r)}function S(t,n){e().removeStyle(t,n)}function C(t){return e().inputValue(t)}function ce(t,n){e().setInputValue(t,n)}function w(){return e().focusedNode()}const T=/* @__PURE__ */ new WeakSet;function E(e,t){return T.add(e),Object.defineProperty(e,"__node_id",{value:t})}function le(e){return typeof e==`object`&&!!e&&T.has(e)}const D=/* @__PURE__ */ new Map,ue=new FinalizationRegistry(e=>{D.get(e)?.deref()||D.delete(e)});function de(e){D.set(e.__node_id,new WeakRef(e)),ue.register(e,e.__node_id)}function fe(e){D.delete(e)}function O(e){return D.get(e)?.deref()}const k=/* @__PURE__ */ new WeakSet;function A(e){return k.has(e)}function j(e){if(k.add(e),e.kind!==`text`){fe(e.__node_id);for(let t of e.children)j(t)}}function pe(e){for(let t of e){let e=O(t);e&&j(e)}}const me=new FinalizationRegistry(t=>e().releaseNode(t));function M(e){me.register(e,e.__node_id)}function N(){let e=w();return e===null?null:O(e)??null}let P=0;function F(){return P}function I(e){return(...t)=>{let n=t[0]?.eventId;return typeof n==`number`&&n>P&&(P=n),e(...t)}}function L(t,n,r,i={}){if(r==null)return;let a=p(t,n,i.capture);if(u(a,r)!==void 0)return;let o=(...e)=>typeof r==`function`?r.apply(e[0]?.currentTarget,e):r.handleEvent.apply(r,e),s=i.once?(...e)=>(R(t,n,r,i),o(...e)):o;l(a,r,e().addEventListener(t,n,i.capture===!0,i.passive===!0),I(s))}function R(t,n,r,i={}){if(r==null)return;let a=u(p(t,n,i.capture),r);a!==void 0&&(e().removeEventListener(t,n,a),d(a))}function z(t,n){return e().dispatchEvent(t,n)}function B(t){e().click(t)}function V(t,n){e().focusNode(t,n)}function H(t){e().blurNode(t)}function he(t,n){e().setPointerCapture(t,n)}function ge(t,n){e().releasePointerCapture(t,n)}function _e(t,n){return e().hasPointerCapture(t,n)}function U(e,t=[]){let n=typeof e==`function`?e:()=>e;return{addEventListener(e,r,i){let a=typeof i==`boolean`?{capture:i}:i??{};L(n(),e,r,{...a,passive:a.passive??t.includes(e)})},removeEventListener(e,t,r){let i=typeof r==`boolean`?r:r?.capture;R(n(),e,t,{capture:i})},dispatchEvent:e=>z(n(),e)}}function W(){throw TypeError(`document cannot be constructed. use the document export of incajs`)}function ve(){throw TypeError(`a shadow root cannot be constructed. the host has no shadow roots`)}Object.defineProperty(globalThis,"Document",{value:W,writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(globalThis,"ShadowRoot",{value:ve,writable:!0,configurable:!0,enumerable:!1});const G=/* @__PURE__ */ Object.defineProperties(Object.setPrototypeOf(a(U(`$document`,[`wheel`]),()=>!1),W.prototype),{[Symbol.toStringTag]:{value:`Document`},activeElement:{get:N}}),K=/* @__PURE__ */ Object.defineProperty(a(U(`$window`,[`wheel`]),()=>!1),Symbol.toStringTag,{value:`Window`});function q(e){return A(e)?null:_(e.__node_id)}function J(e){let t=e.parent;return!q(e)||!t||!q(t)?null:t}function Y(e){let t=q(e);if(!t)return{left:0,top:0};let n=J(e),r=n?q(n):null;return{left:Math.round(t[0]-(r?r[0]+r[4]:0)+t[5])||0,top:Math.round(t[1]-(r?r[1]+r[4]:0)+t[6])||0}}function ye(e){let[t,n,r,i]=e??[0,0,0,0,0],a={x:t,y:n,width:r,height:i,top:n,left:t,right:t+r,bottom:n+i};return{...a,toJSON:()=>({...a})}}function X(e,t){let n=t===`button`||t===`input`?0:-1;if(typeof e!=`string`&&typeof e!=`number`)return n;let r=/^[\t\n\f\r ]*([+-]?\d+)/.exec(String(e));if(!r)return n;let i=Number(r[1])||0;return i>=-2147483648&&i<=2147483647?i:n}function Z(e,t,n){if(A(e))return;let[r,i]=t,[a,o]=typeof r==`object`?[r?.left,r?.top]:[r,i],[s,c]=n?v(e.__node_id)??[0,0]:[0,0],l=(e,t)=>{if(e===void 0)return null;let r=Number(e);return(n?t:0)+(Number.isFinite(r)?r:0)};y(e.__node_id,l(a,s),l(o,c))}function be(e){let t=[`start`,`center`,`end`,`nearest`];return typeof e==`object`&&e?{block:t.includes(e.block??``)?e.block:`start`,inline:t.includes(e.inline??``)?e.inline:`nearest`}:{block:e===!1?`end`:`start`,inline:`nearest`}}function Q(e,t,n,r=[]){let i=U(()=>e,r),o=()=>A(c)?null:v(e),s={get id(){return A(c)?``:String(g(e,`id`)??``)},set id(t){A(c)||h(e,`id`,String(t))},kind:t,parent:null,children:[],focus:t=>{A(c)||V(e,!!t?.preventScroll)},blur:()=>H(e),click:()=>{A(c)||B(e)},setPointerCapture:t=>he(e,t),releasePointerCapture:t=>ge(e,t),hasPointerCapture:t=>_e(e,t),contains:e=>{if(e==null)return!1;if(!le(e))throw TypeError(`the value is not a node. pass an element, a text node or null`);for(let t=e;t!==null;t=t.parent)if(t===c)return!0;return!1},addEventListener:(...e)=>{A(c)||i.addEventListener(...e)},removeEventListener:(...e)=>{A(c)||i.removeEventListener(...e)},dispatchEvent:e=>A(c)||i.dispatchEvent(e),get tabIndex(){return X(A(c)?null:g(e,`tabindex`),n??``)},set tabIndex(t){A(c)||h(e,`tabindex`,t|0)},getBoundingClientRect:()=>ye(q(c)),get offsetWidth(){return Math.round(q(c)?.[2]??0)},get offsetHeight(){return Math.round(q(c)?.[3]??0)},get offsetLeft(){return Y(c).left},get offsetTop(){return Y(c).top},get offsetParent(){return J(c)},get clientWidth(){let e=q(c);return e?Math.max(0,Math.round(e[2]-2*e[4])):0},get clientHeight(){let e=q(c);return e?Math.max(0,Math.round(e[3]-2*e[4])):0},get clientLeft(){return Math.round(q(c)?.[4]??0)},get clientTop(){return Math.round(q(c)?.[4]??0)},get scrollLeft(){return o()?.[0]??0},set scrollLeft(e){Z(c,[e],!1)},get scrollTop(){return o()?.[1]??0},set scrollTop(e){Z(c,[void 0,e],!1)},get scrollWidth(){return c.clientWidth+Math.round(o()?.[2]??0)},get scrollHeight(){return c.clientHeight+Math.round(o()?.[3]??0)},scrollTo:(...e)=>Z(c,e,!1),scrollBy:(...e)=>Z(c,e,!0),scrollIntoView:t=>{if(A(c))return;let{block:n,inline:r}=be(t);b(e,n,r)},getRootNode:()=>{let e=c;for(;e.parent!==null;)e=e.parent;return e.__node_id===m()?G:e}};n===`input`&&Object.defineProperty(s,"value",{get:()=>A(c)?``:C(e),set:t=>{A(c)||ce(e,t===null?``:String(t))},enumerable:!0,configurable:!0});let c=a(E(s,e),()=>A(c));return t===`element`&&de(c),c}function $(){let e=m();return O(e)??Q(e,`element`,void 0,[`wheel`])}Object.defineProperty(globalThis,"__inca_targets__",{value:e=>e.map(e=>e===`$document`?G:e===`$window`?K:O(e)??(e===m()?$():null)),configurable:!0});export{b as A,ne as C,re as D,se as E,v as M,h as N,S as O,x as P,ae as S,oe as T,te as _,U as a,w as b,B as c,F as d,R as f,E as g,M as h,G as i,y as j,m as k,z as l,j as m,$ as n,L as o,A as p,K as r,H as s,Q as t,V as u,ee as v,_ as w,g as x,ie as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{A as t,C as n,D as r,E as i,M as a,N as o,O as s,P as c,S as l,T as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,j as y,k as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as A,w as j,x as M,y as N}from"./hooks-DK2feJxZ.js";function P(e){let t=A(e);return O(t,`element`,e)}function F(e){let t=A(`text`);return o(t,`value`,e),_({kind:`text`,parent:null,text:e},t)}function I(){let e=A(`div`);return c(e,`display`,`none`),O(e,`comment`)}function L(e,t){o(e.__node_id,`value`,t),e.text=t}function R(e,t){for(let t of e.children.splice(0))N(t.__node_id),S(t),t.parent=null;if(!t)return;let n=F(t);d(e.__node_id,n.__node_id),n.parent=e,e.children.push(n)}function z(e){let t=e.parent;if(!t)return;let n=t.children.indexOf(e);n!==-1&&t.children.splice(n,1),e.parent=null}function B(e){e.parent&&r(e.parent.__node_id,e.__node_id),z(e)}function V(e,t,r){if(r===e&&e.parent===t)return;B(e);let i=r?t.children.indexOf(r):-1;n(t.__node_id,e.__node_id,r&&i!==-1?r.__node_id:null),i===-1?t.children.push(e):t.children.splice(i,0,e),e.parent=t}function H(e){z(e),N(e.__node_id),S(e)}function U(e){return e.parent}function W(e){let t=e.parent;if(!t)return null;let n=t.children.indexOf(e);return t.children[n+1]??null}var G=/* @__PURE__ */ e({addEventListener:()=>w,appendChild:()=>d,blur:()=>D,click:()=>m,createCommentNode:()=>I,createElementNode:()=>P,createEventTarget:()=>f,createIncaElement:()=>O,createNode:()=>A,createTextNode:()=>F,destroyNode:()=>N,dispatchEvent:()=>x,focus:()=>k,focusedNode:()=>p,getAttribute:()=>M,holdNode:()=>l,insert:()=>V,insertBefore:()=>n,isDestroyed:()=>T,latestEventId:()=>h,layoutOf:()=>j,nextSibling:()=>W,parentNode:()=>U,releaseNode:()=>u,releaseWhenCollected:()=>v,remove:()=>H,removeAttribute:()=>i,removeChild:()=>r,removeEventListener:()=>g,removeStyle:()=>s,rootElement:()=>C,rootNodeId:()=>b,scrollIntoViewNode:()=>t,scrollNode:()=>y,scrollOf:()=>a,setAttribute:()=>o,setElementText:()=>R,setStyle:()=>c,setText:()=>L,window:()=>E});export{V as a,H as c,F as i,R as l,I as n,W as o,P as r,U as s,G as t,L as u};
|