@barefootjs/shared 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -0
- package/dist/markers.d.ts +10 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/markers.ts +13 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { BF_SCOPE, BF_SLOT, BF_HOST, BF_AT, BF_ROOT, BF_PROPS, BF_COND, BF_ITEM, BF_PORTAL_OWNER, BF_PORTAL_ID, BF_PORTAL_PLACEHOLDER, BF_PARENT_OWNED_PREFIX, BF_SCOPE_COMMENT_PREFIX, BF_LOOP_START, BF_LOOP_END, BF_LOOP_ITEM, loopStartMarker, loopEndMarker, BF_KEY, BF_KEY_PREFIX, BF_PLACEHOLDER, BF_ASYNC, BF_ASYNC_RESOLVE, BF_PARENT_SCOPE_PLACEHOLDER, } from './markers';
|
|
1
|
+
export { BF_SCOPE, BF_SLOT, BF_HOST, BF_AT, BF_ROOT, BF_PROPS, BF_COND, BF_ITEM, BF_PORTAL_OWNER, BF_PORTAL_ID, BF_PORTAL_PLACEHOLDER, BF_PARENT_OWNED_PREFIX, BF_SCOPE_COMMENT_PREFIX, BF_LOOP_START, BF_LOOP_END, BF_LOOP_ITEM, loopItemMarker, loopStartMarker, loopEndMarker, BF_KEY, BF_KEY_PREFIX, BF_PLACEHOLDER, BF_ASYNC, BF_ASYNC_RESOLVE, BF_PARENT_SCOPE_PLACEHOLDER, } from './markers';
|
|
2
2
|
export { classifyDOMProp, toHTMLAttrName, toHTMLAttrNameRuntime, isBooleanAttr, isEventProp, BOOLEAN_ATTRS, } from './dom-prop';
|
|
3
3
|
export type { DOMPropKind, DOMPropClassification } from './dom-prop';
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,9 @@ var BF_SCOPE_COMMENT_PREFIX = "bf-scope:";
|
|
|
15
15
|
var BF_LOOP_START = "bf-loop";
|
|
16
16
|
var BF_LOOP_END = "bf-/loop";
|
|
17
17
|
var BF_LOOP_ITEM = "bf-loop-i";
|
|
18
|
+
function loopItemMarker(key) {
|
|
19
|
+
return `${BF_LOOP_ITEM}:${key}`;
|
|
20
|
+
}
|
|
18
21
|
function loopStartMarker(markerId) {
|
|
19
22
|
return `${BF_LOOP_START}:${markerId}`;
|
|
20
23
|
}
|
|
@@ -194,6 +197,7 @@ export {
|
|
|
194
197
|
toHTMLAttrNameRuntime,
|
|
195
198
|
toHTMLAttrName,
|
|
196
199
|
loopStartMarker,
|
|
200
|
+
loopItemMarker,
|
|
197
201
|
loopEndMarker,
|
|
198
202
|
isEventProp,
|
|
199
203
|
isBooleanAttr,
|
package/dist/markers.d.ts
CHANGED
|
@@ -85,6 +85,16 @@ export declare const BF_LOOP_END = "bf-/loop";
|
|
|
85
85
|
* nodes (#1212).
|
|
86
86
|
*/
|
|
87
87
|
export declare const BF_LOOP_ITEM = "bf-loop-i";
|
|
88
|
+
/**
|
|
89
|
+
* Build the per-item anchor comment value for a loop item: `bf-loop-i:<key>`.
|
|
90
|
+
*
|
|
91
|
+
* The key is embedded in the comment value (comments cannot carry
|
|
92
|
+
* attributes) so an item's identity survives SSR → hydration and so a
|
|
93
|
+
* range-scoped `insert()` can anchor a whole-item conditional to it
|
|
94
|
+
* without a wrapper element. An item's range runs from this anchor until
|
|
95
|
+
* the next `bf-loop-i:*` anchor or the loop end marker.
|
|
96
|
+
*/
|
|
97
|
+
export declare function loopItemMarker(key: string): string;
|
|
88
98
|
/** Build the start-marker comment value for a loop. */
|
|
89
99
|
export declare function loopStartMarker(markerId: string): string;
|
|
90
100
|
/** Build the end-marker comment value for a loop. */
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/markers.ts
CHANGED
|
@@ -122,6 +122,19 @@ export const BF_LOOP_END = 'bf-/loop'
|
|
|
122
122
|
*/
|
|
123
123
|
export const BF_LOOP_ITEM = 'bf-loop-i'
|
|
124
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Build the per-item anchor comment value for a loop item: `bf-loop-i:<key>`.
|
|
127
|
+
*
|
|
128
|
+
* The key is embedded in the comment value (comments cannot carry
|
|
129
|
+
* attributes) so an item's identity survives SSR → hydration and so a
|
|
130
|
+
* range-scoped `insert()` can anchor a whole-item conditional to it
|
|
131
|
+
* without a wrapper element. An item's range runs from this anchor until
|
|
132
|
+
* the next `bf-loop-i:*` anchor or the loop end marker.
|
|
133
|
+
*/
|
|
134
|
+
export function loopItemMarker(key: string): string {
|
|
135
|
+
return `${BF_LOOP_ITEM}:${key}`
|
|
136
|
+
}
|
|
137
|
+
|
|
125
138
|
/** Build the start-marker comment value for a loop. */
|
|
126
139
|
export function loopStartMarker(markerId: string): string {
|
|
127
140
|
return `${BF_LOOP_START}:${markerId}`
|