@bquery/bquery 1.4.0 → 1.5.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.
Files changed (127) hide show
  1. package/README.md +139 -120
  2. package/dist/component/component.d.ts.map +1 -1
  3. package/dist/component/index.d.ts +2 -0
  4. package/dist/component/index.d.ts.map +1 -1
  5. package/dist/component/library.d.ts +34 -0
  6. package/dist/component/library.d.ts.map +1 -0
  7. package/dist/component/types.d.ts +10 -6
  8. package/dist/component/types.d.ts.map +1 -1
  9. package/dist/component-CY5MVoYN.js +531 -0
  10. package/dist/component-CY5MVoYN.js.map +1 -0
  11. package/dist/component.es.mjs +6 -184
  12. package/dist/config-DRmZZno3.js +40 -0
  13. package/dist/config-DRmZZno3.js.map +1 -0
  14. package/dist/core-CK2Mfpf4.js +648 -0
  15. package/dist/core-CK2Mfpf4.js.map +1 -0
  16. package/dist/core-DPdbItcq.js +112 -0
  17. package/dist/core-DPdbItcq.js.map +1 -0
  18. package/dist/core.es.mjs +45 -1261
  19. package/dist/full.d.ts +6 -6
  20. package/dist/full.d.ts.map +1 -1
  21. package/dist/full.es.mjs +98 -92
  22. package/dist/full.iife.js +173 -3
  23. package/dist/full.iife.js.map +1 -1
  24. package/dist/full.umd.js +173 -3
  25. package/dist/full.umd.js.map +1 -1
  26. package/dist/index.es.mjs +143 -139
  27. package/dist/motion/transition.d.ts +1 -1
  28. package/dist/motion/transition.d.ts.map +1 -1
  29. package/dist/motion/types.d.ts +11 -1
  30. package/dist/motion/types.d.ts.map +1 -1
  31. package/dist/motion-C5DRdPnO.js +415 -0
  32. package/dist/motion-C5DRdPnO.js.map +1 -0
  33. package/dist/motion.es.mjs +25 -361
  34. package/dist/object-qGpWr6-J.js +38 -0
  35. package/dist/object-qGpWr6-J.js.map +1 -0
  36. package/dist/platform/announcer.d.ts +59 -0
  37. package/dist/platform/announcer.d.ts.map +1 -0
  38. package/dist/platform/config.d.ts +92 -0
  39. package/dist/platform/config.d.ts.map +1 -0
  40. package/dist/platform/cookies.d.ts +45 -0
  41. package/dist/platform/cookies.d.ts.map +1 -0
  42. package/dist/platform/index.d.ts +8 -0
  43. package/dist/platform/index.d.ts.map +1 -1
  44. package/dist/platform/meta.d.ts +62 -0
  45. package/dist/platform/meta.d.ts.map +1 -0
  46. package/dist/platform-B7JhGBc7.js +361 -0
  47. package/dist/platform-B7JhGBc7.js.map +1 -0
  48. package/dist/platform.es.mjs +11 -248
  49. package/dist/reactive/async-data.d.ts +114 -0
  50. package/dist/reactive/async-data.d.ts.map +1 -0
  51. package/dist/reactive/index.d.ts +2 -2
  52. package/dist/reactive/index.d.ts.map +1 -1
  53. package/dist/reactive/signal.d.ts +2 -0
  54. package/dist/reactive/signal.d.ts.map +1 -1
  55. package/dist/reactive-BDya-ia8.js +253 -0
  56. package/dist/reactive-BDya-ia8.js.map +1 -0
  57. package/dist/reactive.es.mjs +18 -34
  58. package/dist/router-CijiICxt.js +188 -0
  59. package/dist/router-CijiICxt.js.map +1 -0
  60. package/dist/router.es.mjs +11 -200
  61. package/dist/sanitize-jyJ2ryE2.js +302 -0
  62. package/dist/sanitize-jyJ2ryE2.js.map +1 -0
  63. package/dist/security/constants.d.ts.map +1 -1
  64. package/dist/security.es.mjs +10 -56
  65. package/dist/store-CPK9E62U.js +262 -0
  66. package/dist/store-CPK9E62U.js.map +1 -0
  67. package/dist/store.es.mjs +12 -25
  68. package/dist/view-Cdi0g-qo.js +396 -0
  69. package/dist/view-Cdi0g-qo.js.map +1 -0
  70. package/dist/view.es.mjs +10 -430
  71. package/package.json +15 -11
  72. package/src/component/component.ts +319 -289
  73. package/src/component/index.ts +42 -40
  74. package/src/component/library.ts +504 -0
  75. package/src/component/types.ts +91 -85
  76. package/src/core/collection.ts +628 -628
  77. package/src/core/element.ts +774 -774
  78. package/src/core/index.ts +48 -48
  79. package/src/core/utils/function.ts +151 -151
  80. package/src/full.ts +223 -187
  81. package/src/motion/animate.ts +113 -113
  82. package/src/motion/flip.ts +176 -176
  83. package/src/motion/scroll.ts +57 -57
  84. package/src/motion/spring.ts +150 -150
  85. package/src/motion/timeline.ts +246 -246
  86. package/src/motion/transition.ts +53 -7
  87. package/src/motion/types.ts +208 -198
  88. package/src/platform/announcer.ts +208 -0
  89. package/src/platform/config.ts +163 -0
  90. package/src/platform/cookies.ts +165 -0
  91. package/src/platform/index.ts +39 -18
  92. package/src/platform/meta.ts +168 -0
  93. package/src/platform/storage.ts +215 -215
  94. package/src/reactive/async-data.ts +486 -0
  95. package/src/reactive/core.ts +114 -114
  96. package/src/reactive/effect.ts +54 -54
  97. package/src/reactive/index.ts +37 -23
  98. package/src/reactive/internals.ts +122 -122
  99. package/src/reactive/signal.ts +29 -20
  100. package/src/security/constants.ts +211 -209
  101. package/src/security/sanitize-core.ts +364 -364
  102. package/src/view/evaluate.ts +290 -290
  103. package/dist/batch-x7b2eZST.js +0 -13
  104. package/dist/batch-x7b2eZST.js.map +0 -1
  105. package/dist/component.es.mjs.map +0 -1
  106. package/dist/core-BhpuvPhy.js +0 -170
  107. package/dist/core-BhpuvPhy.js.map +0 -1
  108. package/dist/core.es.mjs.map +0 -1
  109. package/dist/full.es.mjs.map +0 -1
  110. package/dist/index.es.mjs.map +0 -1
  111. package/dist/motion.es.mjs.map +0 -1
  112. package/dist/persisted-DHoi3uEs.js +0 -278
  113. package/dist/persisted-DHoi3uEs.js.map +0 -1
  114. package/dist/platform.es.mjs.map +0 -1
  115. package/dist/reactive.es.mjs.map +0 -1
  116. package/dist/router.es.mjs.map +0 -1
  117. package/dist/sanitize-Cxvxa-DX.js +0 -283
  118. package/dist/sanitize-Cxvxa-DX.js.map +0 -1
  119. package/dist/security.es.mjs.map +0 -1
  120. package/dist/store.es.mjs.map +0 -1
  121. package/dist/type-guards-BdKlYYlS.js +0 -32
  122. package/dist/type-guards-BdKlYYlS.js.map +0 -1
  123. package/dist/untrack-DNnnqdlR.js +0 -6
  124. package/dist/untrack-DNnnqdlR.js.map +0 -1
  125. package/dist/view.es.mjs.map +0 -1
  126. package/dist/watch-DXXv3iAI.js +0 -58
  127. package/dist/watch-DXXv3iAI.js.map +0 -1
@@ -1,20 +1,29 @@
1
- /**
2
- * Reactive primitives inspired by fine-grained reactivity.
3
- *
4
- * @module bquery/reactive
5
- */
6
-
7
- export { batch } from './batch';
8
- export { Computed, computed } from './computed';
9
- export { Signal, signal } from './core';
10
- export { effect } from './effect';
11
- export { linkedSignal } from './linked';
12
- export { persistedSignal } from './persisted';
13
- export { readonly } from './readonly';
14
- export { isComputed, isSignal } from './type-guards';
15
- export { untrack } from './untrack';
16
- export { watch } from './watch';
17
-
18
- export type { CleanupFn, Observer } from './internals';
19
- export type { LinkedSignal } from './linked';
20
- export type { ReadonlySignal } from './readonly';
1
+ /**
2
+ * Reactive primitives inspired by fine-grained reactivity.
3
+ *
4
+ * @module bquery/reactive
5
+ */
6
+
7
+ export { batch } from './batch';
8
+ export { createUseFetch, useAsyncData, useFetch } from './async-data';
9
+ export { Computed, computed } from './computed';
10
+ export { Signal, signal } from './core';
11
+ export { effect } from './effect';
12
+ export { linkedSignal } from './linked';
13
+ export { persistedSignal } from './persisted';
14
+ export { readonly } from './readonly';
15
+ export { isComputed, isSignal } from './type-guards';
16
+ export { untrack } from './untrack';
17
+ export { watch } from './watch';
18
+
19
+ export type { CleanupFn, Observer } from './internals';
20
+ export type {
21
+ AsyncDataState,
22
+ AsyncDataStatus,
23
+ AsyncWatchSource,
24
+ FetchInput,
25
+ UseAsyncDataOptions,
26
+ UseFetchOptions,
27
+ } from './async-data';
28
+ export type { LinkedSignal } from './linked';
29
+ export type { ReadonlySignal } from './readonly';
@@ -1,209 +1,211 @@
1
- /**
2
- * Security constants and safe lists.
3
- *
4
- * @module bquery/security
5
- */
6
-
7
- /**
8
- * Trusted Types policy name.
9
- */
10
- export const POLICY_NAME = 'bquery-sanitizer';
11
-
12
- /**
13
- * Default allowed HTML tags considered safe.
14
- */
15
- export const DEFAULT_ALLOWED_TAGS = new Set([
16
- 'a',
17
- 'abbr',
18
- 'address',
19
- 'article',
20
- 'aside',
21
- 'b',
22
- 'bdi',
23
- 'bdo',
24
- 'blockquote',
25
- 'br',
26
- 'button',
27
- 'caption',
28
- 'cite',
29
- 'code',
30
- 'col',
31
- 'colgroup',
32
- 'data',
33
- 'dd',
34
- 'del',
35
- 'details',
36
- 'dfn',
37
- 'div',
38
- 'dl',
39
- 'dt',
40
- 'em',
41
- 'figcaption',
42
- 'figure',
43
- 'footer',
44
- 'form',
45
- 'h1',
46
- 'h2',
47
- 'h3',
48
- 'h4',
49
- 'h5',
50
- 'h6',
51
- 'header',
52
- 'hgroup',
53
- 'hr',
54
- 'i',
55
- 'img',
56
- 'input',
57
- 'ins',
58
- 'kbd',
59
- 'label',
60
- 'legend',
61
- 'li',
62
- 'main',
63
- 'mark',
64
- 'nav',
65
- 'ol',
66
- 'optgroup',
67
- 'option',
68
- 'p',
69
- 'picture',
70
- 'pre',
71
- 'progress',
72
- 'q',
73
- 'rp',
74
- 'rt',
75
- 'ruby',
76
- 's',
77
- 'samp',
78
- 'section',
79
- 'select',
80
- 'small',
81
- 'source',
82
- 'span',
83
- 'strong',
84
- 'sub',
85
- 'summary',
86
- 'sup',
87
- 'table',
88
- 'tbody',
89
- 'td',
90
- 'textarea',
91
- 'tfoot',
92
- 'th',
93
- 'thead',
94
- 'time',
95
- 'tr',
96
- 'u',
97
- 'ul',
98
- 'var',
99
- 'wbr',
100
- ]);
101
-
102
- /**
103
- * Explicitly dangerous tags that should never be allowed.
104
- * These are checked even if somehow added to allowTags.
105
- */
106
- export const DANGEROUS_TAGS = new Set([
107
- 'script',
108
- 'iframe',
109
- 'frame',
110
- 'frameset',
111
- 'object',
112
- 'embed',
113
- 'applet',
114
- 'link',
115
- 'meta',
116
- 'style',
117
- 'base',
118
- 'template',
119
- 'slot',
120
- 'math',
121
- 'svg',
122
- 'foreignobject',
123
- 'noscript',
124
- ]);
125
-
126
- /**
127
- * Reserved IDs that could cause DOM clobbering attacks.
128
- * These are prevented to avoid overwriting global browser objects.
129
- */
130
- export const RESERVED_IDS = new Set([
131
- // Global objects
132
- 'document',
133
- 'window',
134
- 'location',
135
- 'top',
136
- 'self',
137
- 'parent',
138
- 'frames',
139
- 'history',
140
- 'navigator',
141
- 'screen',
142
- // Dangerous functions
143
- 'alert',
144
- 'confirm',
145
- 'prompt',
146
- 'eval',
147
- 'function',
148
- // Document properties
149
- 'cookie',
150
- 'domain',
151
- 'referrer',
152
- 'body',
153
- 'head',
154
- 'forms',
155
- 'images',
156
- 'links',
157
- 'scripts',
158
- // DOM traversal properties
159
- 'children',
160
- 'parentnode',
161
- 'firstchild',
162
- 'lastchild',
163
- // Content manipulation
164
- 'innerhtml',
165
- 'outerhtml',
166
- 'textcontent',
167
- ]);
168
-
169
- /**
170
- * Default allowed attributes considered safe.
171
- * Note: 'style' is excluded by default because inline CSS can be abused for:
172
- * - UI redressing attacks
173
- * - Data exfiltration via url() in CSS
174
- * - CSS injection vectors
175
- * If you need to allow inline styles, add 'style' to allowAttributes in your
176
- * sanitizeHtml options, but ensure you implement proper CSS value validation.
177
- */
178
- export const DEFAULT_ALLOWED_ATTRIBUTES = new Set([
179
- 'alt',
180
- 'class',
181
- 'dir',
182
- 'height',
183
- 'hidden',
184
- 'href',
185
- 'id',
186
- 'lang',
187
- 'loading',
188
- 'name',
189
- 'rel',
190
- 'role',
191
- 'src',
192
- 'srcset',
193
- 'tabindex',
194
- 'target',
195
- 'title',
196
- 'type',
197
- 'width',
198
- 'aria-*',
199
- ]);
200
-
201
- /**
202
- * Dangerous attribute prefixes to always remove.
203
- */
204
- export const DANGEROUS_ATTR_PREFIXES = ['on', 'formaction', 'xlink:', 'xmlns:'];
205
-
206
- /**
207
- * Dangerous URL protocols to block.
208
- */
209
- export const DANGEROUS_PROTOCOLS = ['javascript:', 'data:', 'vbscript:', 'file:'];
1
+ /**
2
+ * Security constants and safe lists.
3
+ *
4
+ * @module bquery/security
5
+ */
6
+
7
+ /**
8
+ * Trusted Types policy name.
9
+ */
10
+ export const POLICY_NAME = 'bquery-sanitizer';
11
+
12
+ /**
13
+ * Default allowed HTML tags considered safe.
14
+ */
15
+ export const DEFAULT_ALLOWED_TAGS = new Set([
16
+ 'a',
17
+ 'abbr',
18
+ 'address',
19
+ 'article',
20
+ 'aside',
21
+ 'b',
22
+ 'bdi',
23
+ 'bdo',
24
+ 'blockquote',
25
+ 'br',
26
+ 'button',
27
+ 'caption',
28
+ 'cite',
29
+ 'code',
30
+ 'col',
31
+ 'colgroup',
32
+ 'data',
33
+ 'dd',
34
+ 'del',
35
+ 'details',
36
+ 'dfn',
37
+ 'div',
38
+ 'dl',
39
+ 'dt',
40
+ 'em',
41
+ 'figcaption',
42
+ 'figure',
43
+ 'footer',
44
+ 'form',
45
+ 'h1',
46
+ 'h2',
47
+ 'h3',
48
+ 'h4',
49
+ 'h5',
50
+ 'h6',
51
+ 'header',
52
+ 'hgroup',
53
+ 'hr',
54
+ 'i',
55
+ 'img',
56
+ 'input',
57
+ 'ins',
58
+ 'kbd',
59
+ 'label',
60
+ 'legend',
61
+ 'li',
62
+ 'main',
63
+ 'mark',
64
+ 'nav',
65
+ 'ol',
66
+ 'optgroup',
67
+ 'option',
68
+ 'p',
69
+ 'picture',
70
+ 'pre',
71
+ 'progress',
72
+ 'q',
73
+ 'rp',
74
+ 'rt',
75
+ 'ruby',
76
+ 's',
77
+ 'samp',
78
+ 'section',
79
+ 'select',
80
+ 'small',
81
+ 'source',
82
+ 'span',
83
+ 'strong',
84
+ 'sub',
85
+ 'summary',
86
+ 'sup',
87
+ 'table',
88
+ 'tbody',
89
+ 'td',
90
+ 'textarea',
91
+ 'tfoot',
92
+ 'th',
93
+ 'thead',
94
+ 'time',
95
+ 'tr',
96
+ 'u',
97
+ 'ul',
98
+ 'var',
99
+ 'wbr',
100
+ ]);
101
+
102
+ /**
103
+ * Explicitly dangerous tags that should never be allowed.
104
+ * These are checked even if somehow added to allowTags.
105
+ */
106
+ export const DANGEROUS_TAGS = new Set([
107
+ 'script',
108
+ 'iframe',
109
+ 'frame',
110
+ 'frameset',
111
+ 'object',
112
+ 'embed',
113
+ 'applet',
114
+ 'link',
115
+ 'meta',
116
+ 'style',
117
+ 'base',
118
+ 'template',
119
+ // 'slot' is intentionally excluded here so component shadow markup can opt in
120
+ // via sanitizeHtml(..., { allowTags: ['slot'] }). It remains disallowed by default
121
+ // for general HTML writes, because DEFAULT_ALLOWED_TAGS does not include it.
122
+ 'math',
123
+ 'svg',
124
+ 'foreignobject',
125
+ 'noscript',
126
+ ]);
127
+
128
+ /**
129
+ * Reserved IDs that could cause DOM clobbering attacks.
130
+ * These are prevented to avoid overwriting global browser objects.
131
+ */
132
+ export const RESERVED_IDS = new Set([
133
+ // Global objects
134
+ 'document',
135
+ 'window',
136
+ 'location',
137
+ 'top',
138
+ 'self',
139
+ 'parent',
140
+ 'frames',
141
+ 'history',
142
+ 'navigator',
143
+ 'screen',
144
+ // Dangerous functions
145
+ 'alert',
146
+ 'confirm',
147
+ 'prompt',
148
+ 'eval',
149
+ 'function',
150
+ // Document properties
151
+ 'cookie',
152
+ 'domain',
153
+ 'referrer',
154
+ 'body',
155
+ 'head',
156
+ 'forms',
157
+ 'images',
158
+ 'links',
159
+ 'scripts',
160
+ // DOM traversal properties
161
+ 'children',
162
+ 'parentnode',
163
+ 'firstchild',
164
+ 'lastchild',
165
+ // Content manipulation
166
+ 'innerhtml',
167
+ 'outerhtml',
168
+ 'textcontent',
169
+ ]);
170
+
171
+ /**
172
+ * Default allowed attributes considered safe.
173
+ * Note: 'style' is excluded by default because inline CSS can be abused for:
174
+ * - UI redressing attacks
175
+ * - Data exfiltration via url() in CSS
176
+ * - CSS injection vectors
177
+ * If you need to allow inline styles, add 'style' to allowAttributes in your
178
+ * sanitizeHtml options, but ensure you implement proper CSS value validation.
179
+ */
180
+ export const DEFAULT_ALLOWED_ATTRIBUTES = new Set([
181
+ 'alt',
182
+ 'class',
183
+ 'dir',
184
+ 'height',
185
+ 'hidden',
186
+ 'href',
187
+ 'id',
188
+ 'lang',
189
+ 'loading',
190
+ 'name',
191
+ 'rel',
192
+ 'role',
193
+ 'src',
194
+ 'srcset',
195
+ 'tabindex',
196
+ 'target',
197
+ 'title',
198
+ 'type',
199
+ 'width',
200
+ 'aria-*',
201
+ ]);
202
+
203
+ /**
204
+ * Dangerous attribute prefixes to always remove.
205
+ */
206
+ export const DANGEROUS_ATTR_PREFIXES = ['on', 'formaction', 'xlink:', 'xmlns:'];
207
+
208
+ /**
209
+ * Dangerous URL protocols to block.
210
+ */
211
+ export const DANGEROUS_PROTOCOLS = ['javascript:', 'data:', 'vbscript:', 'file:'];