octane 0.1.43 → 0.1.44
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/cjs/index.cjs +5 -0
- package/dist/cjs/runtime.cjs +9 -0
- package/dist/cjs/server/index.cjs +5 -0
- package/dist/cjs/sub-slot.cjs +60 -0
- package/dist/cjs/version.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/runtime.js +9 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +6 -0
- package/dist/sub-slot.d.ts +32 -0
- package/dist/sub-slot.js +35 -0
- package/dist/universal-native.d.ts +1 -0
- package/dist/universal-native.js +7 -1
- package/dist/universal.d.ts +1 -0
- package/dist/universal.js +7 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -83,6 +83,7 @@ __export(index_exports, {
|
|
|
83
83
|
createRoot: () => import_runtime.createRoot,
|
|
84
84
|
createScopedElement: () => import_runtime.createScopedElement,
|
|
85
85
|
createScopedValue: () => import_runtime.createScopedValue,
|
|
86
|
+
createSubSlot: () => import_sub_slot.createSubSlot,
|
|
86
87
|
delegateCaptureEvents: () => import_runtime.delegateCaptureEvents,
|
|
87
88
|
delegateEvents: () => import_runtime.delegateEvents,
|
|
88
89
|
descriptorChildren: () => import_runtime.descriptorChildren,
|
|
@@ -189,6 +190,7 @@ __export(index_exports, {
|
|
|
189
190
|
startTransition: () => import_runtime.startTransition,
|
|
190
191
|
styleResource: () => import_runtime.styleResource,
|
|
191
192
|
stylesheetResource: () => import_runtime.stylesheetResource,
|
|
193
|
+
subSlot: () => import_sub_slot.subSlot,
|
|
192
194
|
switchBlock: () => import_runtime.switchBlock,
|
|
193
195
|
template: () => import_runtime.template,
|
|
194
196
|
textHole: () => import_runtime.textHole,
|
|
@@ -228,6 +230,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
228
230
|
var import_version = require("./version.cjs");
|
|
229
231
|
var import_event_capture = require("./hydration/event-capture.cjs");
|
|
230
232
|
var import_behavior_root = require("./behavior-root.cjs");
|
|
233
|
+
var import_sub_slot = require("./sub-slot.cjs");
|
|
231
234
|
var import_runtime = require("./runtime.cjs");
|
|
232
235
|
var import_server_rpc_client = require("./server-rpc-client.cjs");
|
|
233
236
|
var import_method_dep = require("./method-dep.cjs");
|
|
@@ -298,6 +301,7 @@ var import_method_dep = require("./method-dep.cjs");
|
|
|
298
301
|
createRoot,
|
|
299
302
|
createScopedElement,
|
|
300
303
|
createScopedValue,
|
|
304
|
+
createSubSlot,
|
|
301
305
|
delegateCaptureEvents,
|
|
302
306
|
delegateEvents,
|
|
303
307
|
descriptorChildren,
|
|
@@ -404,6 +408,7 @@ var import_method_dep = require("./method-dep.cjs");
|
|
|
404
408
|
startTransition,
|
|
405
409
|
styleResource,
|
|
406
410
|
stylesheetResource,
|
|
411
|
+
subSlot,
|
|
407
412
|
switchBlock,
|
|
408
413
|
template,
|
|
409
414
|
textHole,
|
package/dist/cjs/runtime.cjs
CHANGED
|
@@ -6215,6 +6215,15 @@ class HydrationCapability {
|
|
|
6215
6215
|
}
|
|
6216
6216
|
return first;
|
|
6217
6217
|
}
|
|
6218
|
+
if (this.isOpen(first)) {
|
|
6219
|
+
const child2 = first.nextSibling;
|
|
6220
|
+
const end = child2?.nextSibling ?? null;
|
|
6221
|
+
if (child2?.nodeType === 3 && this.isClose(end) && end.nextSibling === null) {
|
|
6222
|
+
first.remove();
|
|
6223
|
+
end.remove();
|
|
6224
|
+
return this.htext(el, text, loc);
|
|
6225
|
+
}
|
|
6226
|
+
}
|
|
6218
6227
|
const created = document.createTextNode(text);
|
|
6219
6228
|
el.appendChild(created);
|
|
6220
6229
|
return created;
|
|
@@ -38,6 +38,7 @@ __export(server_exports, {
|
|
|
38
38
|
createPortal: () => import_runtime_server.createPortal,
|
|
39
39
|
createScopedElement: () => import_runtime_server.createScopedElement,
|
|
40
40
|
createScopedValue: () => import_runtime_server.createScopedValue,
|
|
41
|
+
createSubSlot: () => import_sub_slot.createSubSlot,
|
|
41
42
|
descriptorChildren: () => import_runtime_server.descriptorChildren,
|
|
42
43
|
escapeAttr: () => import_runtime_server.escapeAttr,
|
|
43
44
|
escapeHtml: () => import_runtime_server.escapeHtml,
|
|
@@ -115,6 +116,7 @@ __export(server_exports, {
|
|
|
115
116
|
ssrValueAttr: () => import_runtime_server.ssrValueAttr,
|
|
116
117
|
ssrVoidContent: () => import_runtime_server.ssrVoidContent,
|
|
117
118
|
startTransition: () => import_runtime_server.startTransition,
|
|
119
|
+
subSlot: () => import_sub_slot.subSlot,
|
|
118
120
|
unstable_Activity: () => import_runtime_server.Activity,
|
|
119
121
|
unstable_ViewTransition: () => import_runtime_server.ViewTransition,
|
|
120
122
|
unstable_addTransitionType: () => import_runtime_server.addTransitionType,
|
|
@@ -145,6 +147,7 @@ __export(server_exports, {
|
|
|
145
147
|
});
|
|
146
148
|
module.exports = __toCommonJS(server_exports);
|
|
147
149
|
var import_rpc = require("./rpc.cjs");
|
|
150
|
+
var import_sub_slot = require("../sub-slot.cjs");
|
|
148
151
|
var import_method_dep = require("../method-dep.cjs");
|
|
149
152
|
var import_runtime_server = require("../runtime.server.cjs");
|
|
150
153
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -169,6 +172,7 @@ var import_runtime_server = require("../runtime.server.cjs");
|
|
|
169
172
|
createPortal,
|
|
170
173
|
createScopedElement,
|
|
171
174
|
createScopedValue,
|
|
175
|
+
createSubSlot,
|
|
172
176
|
descriptorChildren,
|
|
173
177
|
escapeAttr,
|
|
174
178
|
escapeHtml,
|
|
@@ -246,6 +250,7 @@ var import_runtime_server = require("../runtime.server.cjs");
|
|
|
246
250
|
ssrValueAttr,
|
|
247
251
|
ssrVoidContent,
|
|
248
252
|
startTransition,
|
|
253
|
+
subSlot,
|
|
249
254
|
unstable_Activity,
|
|
250
255
|
unstable_ViewTransition,
|
|
251
256
|
unstable_addTransitionType,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var sub_slot_exports = {};
|
|
20
|
+
__export(sub_slot_exports, {
|
|
21
|
+
createSubSlot: () => createSubSlot,
|
|
22
|
+
subSlot: () => subSlot
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(sub_slot_exports);
|
|
25
|
+
function createSubSlot(options = {}) {
|
|
26
|
+
const childSlots = /* @__PURE__ */ new Map();
|
|
27
|
+
const slotlessSlots = options.slotlessPrefix === void 0 ? null : /* @__PURE__ */ new Map();
|
|
28
|
+
const parentPrefix = options.parentPrefix ?? "";
|
|
29
|
+
const tagPrefix = options.tagPrefix ?? ":";
|
|
30
|
+
const parentDescriptionFallback = options.parentDescriptionFallback ?? "";
|
|
31
|
+
const includeParentDescription = options.includeParentDescription !== false;
|
|
32
|
+
const makeSymbol = options.global === false ? Symbol : Symbol.for;
|
|
33
|
+
const makeSlotlessSymbol = options.slotlessGlobal === false || options.slotlessGlobal === void 0 && options.global === false ? Symbol : Symbol.for;
|
|
34
|
+
return (slot, tag) => {
|
|
35
|
+
if (slot === void 0) {
|
|
36
|
+
if (slotlessSlots === null) return void 0;
|
|
37
|
+
let child2 = slotlessSlots.get(tag);
|
|
38
|
+
if (child2 === void 0) {
|
|
39
|
+
child2 = makeSlotlessSymbol(options.slotlessPrefix + tag);
|
|
40
|
+
slotlessSlots.set(tag, child2);
|
|
41
|
+
}
|
|
42
|
+
return child2;
|
|
43
|
+
}
|
|
44
|
+
let byTag = childSlots.get(slot);
|
|
45
|
+
if (byTag === void 0) childSlots.set(slot, byTag = /* @__PURE__ */ new Map());
|
|
46
|
+
let child = byTag.get(tag);
|
|
47
|
+
if (child === void 0) {
|
|
48
|
+
const parentDescription = includeParentDescription ? slot.description ?? parentDescriptionFallback : "";
|
|
49
|
+
child = makeSymbol(parentPrefix + parentDescription + tagPrefix + tag);
|
|
50
|
+
byTag.set(tag, child);
|
|
51
|
+
}
|
|
52
|
+
return child;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const subSlot = createSubSlot();
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
createSubSlot,
|
|
59
|
+
subSlot
|
|
60
|
+
});
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const version = "0.1.
|
|
24
|
+
const version = "0.1.44";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { version } from './version.js';
|
|
|
2
2
|
export { initializeHydrationEventCapture } from './hydration/event-capture.js';
|
|
3
3
|
export { attachBehaviorRoot } from './behavior-root.js';
|
|
4
4
|
export type * from './behavior-root.js';
|
|
5
|
+
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from './sub-slot.js';
|
|
5
6
|
export { createRoot, hydrateRoot, flushSync, act, type Root, type RootOptions, useState, useLinkedState, type LinkedStatePrevious, type LinkedStateOptions, useReducer, useEffect, useLayoutEffect, useInsertionEffect, useMemo, useCallback, useRef, useId, useImperativeHandle, useEffectEvent, useSyncExternalStore, useDeferredValue, useTransition, useActionState, useFormStatus, useOptimistic, useDebugValue, type FormStatus, startTransition, requestFormReset, memo, lazy, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, createContext, use, useContext, type Context, type ForeignHostContext, Suspense, ErrorBoundary, Hydrate, Activity, Activity as unstable_Activity, ViewTransition, addTransitionType, ViewTransition as unstable_ViewTransition, addTransitionType as unstable_addTransitionType, ViewTransitionPseudoElement, type ViewTransitionProps, type ViewTransitionInstance, Fragment, createPortal, type PortalDescriptor, createElement, cloneElement, isValidElement, isChildrenBlock, Children, type ElementDescriptor, type ComponentBody, type OctaneNode, TsrxErrorBoundary, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, __createVoidRoot, bindRendererRegionOwner, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, createHostContextRequest, __vtSeen, template, clone, drainFrag, bag0, bag1, bag2, bag3, bag4, bag5, bag6, bag7, bag8, bag9, bag10, bag11, bag12, bag13, bag14, bag15, bag16, bagOf, evt0, evt0u, evt1, evt1u, evt2, evt2u, evtN, evtNu, devEventListener, devHtmlNesting, htext, htextSwap, child, sibling, setText, setScriptText, setHTML, setDangerouslySetInnerHTML, setDangerouslySetInnerHTMLSources, markDangerouslySetInnerHTMLChildren, setAttribute, setStringData, setBooleanAttribute, setAriaAttribute, setClassName, setClassAttr, normalizeClass, setStyle, setStyleProperty, setSpread, snapshotSpread, setHostPropSources, queueNativeChangeDiagnostic, queueFormAuthoringDiagnostic, markNativeChangeDiagnosticStatic, setFormAction, setValue, setFormControlSources, setChecked, setCheckedCheckable, setSelectValue, setDefaultValue, setDefaultValueUncontrolled, setDefaultChecked, setAutoFocus, attachRef, queueRefAttach, queueRefDetach, replaceRef, queueOwnRefDetach, injectStyle, headBlock, stylesheetResource, styleResource, scriptResource, namespaceHead, namespaceHeadElement, delegateEvents, delegateCaptureEvents, fastForBlock, fastKeyedForBlock, fastMapSlot, forBlock, keyedForBlock, mapSlot, ifBlock, errorBlock, tryBlock, switchBlock, activityBlock, componentSlot, componentSlotVoid, componentSlotLite, compilerCacheArray, compilerCacheImmutableArrayFilter, compilerCacheMappedArray, compilerCacheContext, compilerOwnsContextProvider, markSingleRoot, markSingleRoot as __s, markChildrenBlock, descriptorChildren, createScopedValue, createScopedElement, childSlot, positionalChildren, textSlot, textHole, childTextHole, hostComponent, renderBlock, portal, hookSlots, withSlot, useBatch, seedOrCreate, warmMemo, warmChild, puMiss, puTake0, puTake1, puTake2, puTake3, puTake4, puPub, provideContext, mountFragmentRef, FragmentInstance, hmr, HMR, hasPendingWork, type Scope, type Block, drainPassiveEffects, setIsOctaneActEnvironment, resetFloatResourceState, setTransitionFallbackTimeout, getTransitionFallbackTimeout, } from './runtime.js';
|
|
6
7
|
export type { HydrateOptions, HydrateProps, HydrateWhen, HydrationInteractionEvent, HydrationInteractionEvents, HydrationPrefetchContext, HydrationPrefetchFunction, HydrationPrefetchStrategy, HydrationPrefetchWaitReason, HydrationStrategy, HydrationWhen, } from './hydration/types.js';
|
|
7
8
|
export { __serverRpc } from './server-rpc-client.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { version } from "./version.js";
|
|
2
2
|
import { initializeHydrationEventCapture } from "./hydration/event-capture.js";
|
|
3
3
|
import { attachBehaviorRoot } from "./behavior-root.js";
|
|
4
|
+
import {
|
|
5
|
+
createSubSlot,
|
|
6
|
+
subSlot
|
|
7
|
+
} from "./sub-slot.js";
|
|
4
8
|
import {
|
|
5
9
|
createRoot,
|
|
6
10
|
hydrateRoot,
|
|
@@ -271,6 +275,7 @@ export {
|
|
|
271
275
|
createRoot,
|
|
272
276
|
createScopedElement,
|
|
273
277
|
createScopedValue,
|
|
278
|
+
createSubSlot,
|
|
274
279
|
delegateCaptureEvents,
|
|
275
280
|
delegateEvents,
|
|
276
281
|
descriptorChildren,
|
|
@@ -377,6 +382,7 @@ export {
|
|
|
377
382
|
startTransition,
|
|
378
383
|
styleResource,
|
|
379
384
|
stylesheetResource,
|
|
385
|
+
subSlot,
|
|
380
386
|
switchBlock,
|
|
381
387
|
template,
|
|
382
388
|
textHole,
|
package/dist/runtime.js
CHANGED
|
@@ -6065,6 +6065,15 @@ class HydrationCapability {
|
|
|
6065
6065
|
}
|
|
6066
6066
|
return first;
|
|
6067
6067
|
}
|
|
6068
|
+
if (this.isOpen(first)) {
|
|
6069
|
+
const child2 = first.nextSibling;
|
|
6070
|
+
const end = child2?.nextSibling ?? null;
|
|
6071
|
+
if (child2?.nodeType === 3 && this.isClose(end) && end.nextSibling === null) {
|
|
6072
|
+
first.remove();
|
|
6073
|
+
end.remove();
|
|
6074
|
+
return this.htext(el, text, loc);
|
|
6075
|
+
}
|
|
6076
|
+
}
|
|
6068
6077
|
const created = document.createTextNode(text);
|
|
6069
6078
|
el.appendChild(created);
|
|
6070
6079
|
return created;
|
package/dist/server/index.d.ts
CHANGED
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
* should call them.
|
|
22
22
|
*/
|
|
23
23
|
export { executeServerFunction } from './rpc.js';
|
|
24
|
+
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from '../sub-slot.js';
|
|
24
25
|
export { __methodDep } from '../method-dep.js';
|
|
25
26
|
export { renderToString, renderToStaticMarkup, renderToPipeableStream, renderToReadableStream, type RenderResult, type RenderOptions, type StreamOptions, type StreamInjectionSource, setSsrSuspenseTimeout, getSsrSuspenseTimeout, EXTERNAL_HYDRATION_PROMISE, HYDRATION_RANGE_BOUNDARY, useState, useLinkedState, useReducer, __useStateWithGetter, __useLinkedStateWithGetter, __useReducerWithGetter, type LinkedStatePrevious, type LinkedStateOptions, useEffect, useLayoutEffect, useInsertionEffect, useImperativeHandle, useMemo, useCallback, useRef, useId, useEffectEvent, useTransition, useDeferredValue, useSyncExternalStore, useActionState, useFormStatus, useOptimistic, useDebugValue, memo, lazy, hookSlots, withSlot, startTransition, flushSync, isChildrenBlock, isValidElement, cloneElement, Children, createPortal, requestFormReset, preload, preinit, preloadModule, preinitModule, preconnect, prefetchDNS, Suspense, ErrorBoundary, Hydrate, Fragment, Activity, Activity as unstable_Activity, ViewTransition, ViewTransition as unstable_ViewTransition, addTransitionType, addTransitionType as unstable_addTransitionType, createContext, use, useContext, ssrIsSuspense, type Context, type FormStatus, markChildrenBlock, descriptorChildren, createElement, createScopedValue, createScopedElement, positionalChildren, escapeHtml, escapeAttr, ssrText, ssrTextPre, ssrNestingText, ssrChild, ssrChildText, ssrAttr, normalizeClass, ssrStyle, ssrClass, ssrAttrs, ssrSnapshotSpread, ssrSpread, ssrInnerHtml, ssrScriptInnerHtml, ssrChildrenSources, ssrSpreadContent, ssrVoidContent, ssrValueAttr, ssrCheckedAttr, ssrInputAttrs, ssrFormAuthoringDiagnostics, ssrTextareaValue, ssrTextareaValueSources, ssrSelectAttrs, ssrSelectScope, ssrSelectScopeSources, ssrOptionValueSources, ssrOption, ssrElement, ssrComponent, ssrComponentNS, ssrInNamespace, ssrBlock, ssrFragmentMarker, ssrActivity, ssrForBlock, mapSlot, ssrControl, ssrArm, ssrTry, ssrPortal, injectStyle, ssrHeadEl, ssrStylesheetResource, ssrStyleResource, ssrScriptResource, namespaceHead, namespaceHeadElement, puMemo, puBatch, warmMemo, warmChild, } from '../runtime.server.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { executeServerFunction } from "./rpc.js";
|
|
2
|
+
import {
|
|
3
|
+
createSubSlot,
|
|
4
|
+
subSlot
|
|
5
|
+
} from "../sub-slot.js";
|
|
2
6
|
import { __methodDep } from "../method-dep.js";
|
|
3
7
|
import {
|
|
4
8
|
renderToString,
|
|
@@ -145,6 +149,7 @@ export {
|
|
|
145
149
|
createPortal,
|
|
146
150
|
createScopedElement,
|
|
147
151
|
createScopedValue,
|
|
152
|
+
createSubSlot,
|
|
148
153
|
descriptorChildren,
|
|
149
154
|
escapeAttr,
|
|
150
155
|
escapeHtml,
|
|
@@ -222,6 +227,7 @@ export {
|
|
|
222
227
|
ssrValueAttr,
|
|
223
228
|
ssrVoidContent,
|
|
224
229
|
startTransition,
|
|
230
|
+
subSlot,
|
|
225
231
|
Activity2 as unstable_Activity,
|
|
226
232
|
ViewTransition2 as unstable_ViewTransition,
|
|
227
233
|
addTransitionType2 as unstable_addTransitionType,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting and identity options for binding-owned hook sub-slots.
|
|
3
|
+
*
|
|
4
|
+
* The defaults preserve the long-standing `parent:tag` global-symbol shape.
|
|
5
|
+
* Bindings with an uncompiled-caller fallback can opt into a stable tag-only
|
|
6
|
+
* symbol with `slotlessPrefix`; bindings that must distinguish two parent
|
|
7
|
+
* symbols with the same description can set `global` to `false`.
|
|
8
|
+
*/
|
|
9
|
+
export interface SubSlotOptions {
|
|
10
|
+
/** Text before the parent slot description. */
|
|
11
|
+
parentPrefix?: string;
|
|
12
|
+
/** Text between the parent slot description and the child tag. */
|
|
13
|
+
tagPrefix?: string;
|
|
14
|
+
/** Description used when a parent symbol has no description. */
|
|
15
|
+
parentDescriptionFallback?: string;
|
|
16
|
+
/** Text before a tag-only child; omitting it preserves an undefined parent. */
|
|
17
|
+
slotlessPrefix?: string;
|
|
18
|
+
/** Include the parent symbol's description in the child description. */
|
|
19
|
+
includeParentDescription?: boolean;
|
|
20
|
+
/** Use `Symbol.for`; set to false for factory-local child identities. */
|
|
21
|
+
global?: boolean;
|
|
22
|
+
/** Override global/local identity for tag-only children. */
|
|
23
|
+
slotlessGlobal?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type SubSlot = (slot: symbol | undefined, tag: string) => symbol | undefined;
|
|
26
|
+
export type SlotlessSubSlot = (slot: symbol | undefined, tag: string) => symbol;
|
|
27
|
+
export declare function createSubSlot(options: SubSlotOptions & {
|
|
28
|
+
slotlessPrefix: string;
|
|
29
|
+
}): SlotlessSubSlot;
|
|
30
|
+
export declare function createSubSlot(options?: SubSlotOptions): SubSlot;
|
|
31
|
+
/** Default binding helper: global `parent:tag` children and no slotless fallback. */
|
|
32
|
+
export declare const subSlot: SubSlot;
|
package/dist/sub-slot.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function createSubSlot(options = {}) {
|
|
2
|
+
const childSlots = /* @__PURE__ */ new Map();
|
|
3
|
+
const slotlessSlots = options.slotlessPrefix === void 0 ? null : /* @__PURE__ */ new Map();
|
|
4
|
+
const parentPrefix = options.parentPrefix ?? "";
|
|
5
|
+
const tagPrefix = options.tagPrefix ?? ":";
|
|
6
|
+
const parentDescriptionFallback = options.parentDescriptionFallback ?? "";
|
|
7
|
+
const includeParentDescription = options.includeParentDescription !== false;
|
|
8
|
+
const makeSymbol = options.global === false ? Symbol : Symbol.for;
|
|
9
|
+
const makeSlotlessSymbol = options.slotlessGlobal === false || options.slotlessGlobal === void 0 && options.global === false ? Symbol : Symbol.for;
|
|
10
|
+
return (slot, tag) => {
|
|
11
|
+
if (slot === void 0) {
|
|
12
|
+
if (slotlessSlots === null) return void 0;
|
|
13
|
+
let child2 = slotlessSlots.get(tag);
|
|
14
|
+
if (child2 === void 0) {
|
|
15
|
+
child2 = makeSlotlessSymbol(options.slotlessPrefix + tag);
|
|
16
|
+
slotlessSlots.set(tag, child2);
|
|
17
|
+
}
|
|
18
|
+
return child2;
|
|
19
|
+
}
|
|
20
|
+
let byTag = childSlots.get(slot);
|
|
21
|
+
if (byTag === void 0) childSlots.set(slot, byTag = /* @__PURE__ */ new Map());
|
|
22
|
+
let child = byTag.get(tag);
|
|
23
|
+
if (child === void 0) {
|
|
24
|
+
const parentDescription = includeParentDescription ? slot.description ?? parentDescriptionFallback : "";
|
|
25
|
+
child = makeSymbol(parentPrefix + parentDescription + tagPrefix + tag);
|
|
26
|
+
byTag.set(tag, child);
|
|
27
|
+
}
|
|
28
|
+
return child;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const subSlot = createSubSlot();
|
|
32
|
+
export {
|
|
33
|
+
createSubSlot,
|
|
34
|
+
subSlot
|
|
35
|
+
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* do not provide DOM globals.
|
|
8
8
|
*/
|
|
9
9
|
export * from './universal-core.js';
|
|
10
|
+
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from './sub-slot.js';
|
|
10
11
|
import { type UniversalContext, type UniversalContextValue, type UniversalRenderable } from './universal-core.js';
|
|
11
12
|
export interface NativeUniversalContext<T> extends UniversalContext<T> {
|
|
12
13
|
(props: {
|
package/dist/universal-native.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * from "./universal-core.js";
|
|
2
|
+
import {
|
|
3
|
+
createSubSlot,
|
|
4
|
+
subSlot
|
|
5
|
+
} from "./sub-slot.js";
|
|
2
6
|
import {
|
|
3
7
|
universalContext
|
|
4
8
|
} from "./universal-core.js";
|
|
@@ -17,5 +21,7 @@ function createContext(defaultValue) {
|
|
|
17
21
|
return context;
|
|
18
22
|
}
|
|
19
23
|
export {
|
|
20
|
-
createContext
|
|
24
|
+
createContext,
|
|
25
|
+
createSubSlot,
|
|
26
|
+
subSlot
|
|
21
27
|
};
|
package/dist/universal.d.ts
CHANGED
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
* retains Octane's existing DOM `createContext` identity.
|
|
7
7
|
*/
|
|
8
8
|
export * from './universal-core.js';
|
|
9
|
+
export { createSubSlot, subSlot, type SubSlot, type SlotlessSubSlot, type SubSlotOptions, } from './sub-slot.js';
|
|
9
10
|
export { createContext } from './runtime.js';
|
|
10
11
|
export { createUniversalHostBoundary, registerUniversalHostBridge, } from './universal-dom-boundary.js';
|
package/dist/universal.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * from "./universal-core.js";
|
|
2
|
+
import {
|
|
3
|
+
createSubSlot,
|
|
4
|
+
subSlot
|
|
5
|
+
} from "./sub-slot.js";
|
|
2
6
|
import { createContext } from "./runtime.js";
|
|
3
7
|
import {
|
|
4
8
|
createUniversalHostBoundary,
|
|
@@ -6,6 +10,8 @@ import {
|
|
|
6
10
|
} from "./universal-dom-boundary.js";
|
|
7
11
|
export {
|
|
8
12
|
createContext,
|
|
13
|
+
createSubSlot,
|
|
9
14
|
createUniversalHostBoundary,
|
|
10
|
-
registerUniversalHostBridge
|
|
15
|
+
registerUniversalHostBridge,
|
|
16
|
+
subSlot
|
|
11
17
|
};
|
package/dist/version.js
CHANGED