@opentui/solid 0.3.4 → 0.4.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/components.js +106 -4
- package/components.js.map +10 -0
- package/index.bun.js +1609 -0
- package/index.bun.js.map +22 -0
- package/index.d.ts +1 -1
- package/index.js +146 -72
- package/index.js.map +22 -0
- package/jsx-dev-runtime.d.ts +1 -0
- package/jsx-dev-runtime.js +2 -0
- package/jsx-dev-runtime.js.map +1 -0
- package/jsx-runtime.d.ts +9 -6
- package/jsx-runtime.js +31 -0
- package/jsx-runtime.js.map +1 -0
- package/package.json +27 -9
- package/scripts/preload.js +3 -0
- package/scripts/preload.js.map +1 -0
- package/scripts/preload.node.js +9 -0
- package/scripts/runtime-plugin-support-configure.js +67 -0
- package/scripts/runtime-plugin-support-configure.js.map +1 -0
- package/scripts/runtime-plugin-support-configure.node.js +11 -0
- package/scripts/runtime-plugin-support.js +4 -0
- package/scripts/runtime-plugin-support.js.map +1 -0
- package/scripts/runtime-plugin-support.node.js +11 -0
- package/scripts/solid-plugin.d.ts +1 -1
- package/scripts/solid-plugin.js +76 -0
- package/scripts/solid-plugin.js.map +1 -0
- package/scripts/solid-plugin.node.js +21 -0
- package/scripts/solid-transform.d.ts +10 -0
- package/scripts/solid-transform.js +66 -0
- package/scripts/solid-transform.js.map +1 -0
- package/src/elements/extras.d.ts +2 -2
- package/src/testing/bun-test-node.d.ts +12 -0
- package/src/types/elements.d.ts +1 -1
- package/chunk-7fkmdv3h.js +0 -110
- package/dist/chunk-7fkmdv3h.d.ts +0 -81
- package/dist/index.d.ts +0 -118
- package/scripts/preload.ts +0 -3
- package/scripts/runtime-plugin-support-configure.ts +0 -109
- package/scripts/runtime-plugin-support.ts +0 -6
- package/scripts/solid-plugin.ts +0 -148
package/index.bun.js.map
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["index.ts", "src/elements/catalogue.ts", "src/elements/hooks.ts", "src/elements/extras.ts", "src/reconciler.ts", "src/renderer/universal.js", "src/renderer/index.ts", "src/utils/id-counter.ts", "src/utils/log.ts", "src/elements/slot.ts", "src/scrollback.ts", "src/time-to-first-draw.tsx", "src/plugins/slot.tsx"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { CliRenderer, createCliRenderer, engine, type CliRendererConfig } from \"@opentui/core\"\nimport { createTestRenderer, type TestRendererOptions } from \"@opentui/core/testing\"\nimport type { JSX } from \"./jsx-runtime.js\"\nimport { RendererContext } from \"./src/elements/index.js\"\nimport { _render as renderInternal, createComponent } from \"./src/reconciler.js\"\n\ntype DisposeFn = () => void\n\nconst mountSolidRoot = (renderer: CliRenderer, node: () => JSX.Element) => {\n let dispose: DisposeFn | undefined\n let disposeRequested = false\n let disposed = false\n let mounting = true\n let destroyRequested = false\n\n const originalDestroy = renderer.destroy.bind(renderer)\n\n const runDispose = () => {\n if (disposed) {\n return\n }\n\n if (!dispose) {\n disposeRequested = true\n return\n }\n\n disposed = true\n dispose()\n }\n\n renderer.once(\"destroy\", runDispose)\n\n renderer.destroy = () => {\n if (mounting) {\n destroyRequested = true\n return\n }\n\n originalDestroy()\n }\n\n try {\n dispose = renderInternal(\n () =>\n createComponent(RendererContext.Provider, {\n get value() {\n return renderer\n },\n get children() {\n return (createComponent as any)(node, {})\n },\n }),\n renderer.root,\n )\n } finally {\n mounting = false\n renderer.destroy = originalDestroy\n }\n\n if (disposeRequested) {\n runDispose()\n }\n\n if (destroyRequested) {\n originalDestroy()\n }\n}\n\nexport const render = async (node: () => JSX.Element, rendererOrConfig: CliRenderer | CliRendererConfig = {}) => {\n const renderer =\n rendererOrConfig instanceof CliRenderer\n ? rendererOrConfig\n : await createCliRenderer({\n ...rendererOrConfig,\n onDestroy: () => {\n rendererOrConfig.onDestroy?.()\n },\n })\n\n engine.attach(renderer)\n mountSolidRoot(renderer, node)\n}\n\nexport const testRender = async (node: () => JSX.Element, renderConfig: TestRendererOptions = {}) => {\n const testSetup = await createTestRenderer({\n ...renderConfig,\n onDestroy: () => {\n renderConfig.onDestroy?.()\n },\n })\n\n engine.attach(testSetup.renderer)\n mountSolidRoot(testSetup.renderer, node)\n\n return testSetup\n}\n\nexport * from \"./src/reconciler.js\"\nexport * from \"./src/elements/index.js\"\nexport * from \"./src/scrollback.js\"\nexport * from \"./src/time-to-first-draw.js\"\nexport * from \"./src/plugins/slot.js\"\nexport * from \"./src/types/elements.js\"\nexport { type JSX }\n",
|
|
6
|
+
"import {\n ASCIIFontRenderable,\n BoxRenderable,\n CodeRenderable,\n DiffRenderable,\n InputRenderable,\n LineNumberRenderable,\n MarkdownRenderable,\n ScrollBoxRenderable,\n SelectRenderable,\n TabSelectRenderable,\n TextareaRenderable,\n TextAttributes,\n TextNodeRenderable,\n TextRenderable,\n type RenderContext,\n type TextNodeOptions,\n} from \"@opentui/core\"\nimport type { RenderableConstructor } from \"../types/elements.js\"\n\nclass SpanRenderable extends TextNodeRenderable {\n constructor(\n private readonly _ctx: RenderContext | null,\n options: TextNodeOptions,\n ) {\n super(options)\n }\n}\n\nexport const textNodeKeys = [\"span\", \"b\", \"strong\", \"i\", \"em\", \"u\", \"a\"] as const\nexport type TextNodeKey = (typeof textNodeKeys)[number]\n\nclass TextModifierRenderable extends SpanRenderable {\n constructor(options: any, modifier?: TextNodeKey) {\n super(null, options)\n\n // Set appropriate attributes based on modifier type\n if (modifier === \"b\" || modifier === \"strong\") {\n this.attributes = (this.attributes || 0) | TextAttributes.BOLD\n } else if (modifier === \"i\" || modifier === \"em\") {\n this.attributes = (this.attributes || 0) | TextAttributes.ITALIC\n } else if (modifier === \"u\") {\n this.attributes = (this.attributes || 0) | TextAttributes.UNDERLINE\n }\n }\n}\n\nexport class BoldSpanRenderable extends TextModifierRenderable {\n constructor(options: any) {\n super(options, \"b\")\n }\n}\n\nexport class ItalicSpanRenderable extends TextModifierRenderable {\n constructor(options: any) {\n super(options, \"i\")\n }\n}\n\nexport class UnderlineSpanRenderable extends TextModifierRenderable {\n constructor(options: any) {\n super(options, \"u\")\n }\n}\n\nexport class LineBreakRenderable extends SpanRenderable {\n constructor(_ctx: RenderContext | null, options: TextNodeOptions) {\n super(null, options)\n this.add()\n }\n\n public override add(): number {\n return super.add(\"\\n\")\n }\n}\n\nexport interface LinkOptions extends TextNodeOptions {\n href: string\n}\n\nexport class LinkRenderable extends SpanRenderable {\n constructor(_ctx: RenderContext | null, options: LinkOptions) {\n const linkOptions: TextNodeOptions = {\n ...options,\n link: { url: options.href },\n }\n super(null, linkOptions)\n }\n}\n\nexport const baseComponents = {\n box: BoxRenderable,\n text: TextRenderable,\n input: InputRenderable,\n select: SelectRenderable,\n textarea: TextareaRenderable,\n ascii_font: ASCIIFontRenderable,\n tab_select: TabSelectRenderable,\n scrollbox: ScrollBoxRenderable,\n code: CodeRenderable,\n diff: DiffRenderable,\n line_number: LineNumberRenderable,\n markdown: MarkdownRenderable,\n\n span: SpanRenderable,\n strong: BoldSpanRenderable,\n b: BoldSpanRenderable,\n em: ItalicSpanRenderable,\n i: ItalicSpanRenderable,\n u: UnderlineSpanRenderable,\n br: LineBreakRenderable,\n a: LinkRenderable,\n}\n\ntype ComponentCatalogue = Record<string, RenderableConstructor>\n\nexport const componentCatalogue: ComponentCatalogue = { ...baseComponents }\n\n/**\n * Extend the component catalogue with new renderable components\n *\n * @example\n * ```tsx\n * // Extend with an object of components\n * extend({\n * consoleButton: ButtonRenderable,\n * customBox: CustomBoxRenderable\n * })\n * ```\n */\nexport function extend<T extends ComponentCatalogue>(objects: T): void {\n Object.assign(componentCatalogue, objects)\n}\n\nexport function getComponentCatalogue(): ComponentCatalogue {\n return componentCatalogue\n}\n\nexport type { ExtendedComponentProps, ExtendedIntrinsicElements, RenderableConstructor } from \"../types/elements.js\"\n",
|
|
7
|
+
"import {\n engine,\n PasteEvent,\n Selection,\n Timeline,\n type CliRenderer,\n type KeyEvent,\n type TimelineOptions,\n} from \"@opentui/core\"\nimport { createContext, createSignal, onCleanup, onMount, useContext } from \"solid-js\"\n\nexport const RendererContext = createContext<CliRenderer>()\n\nexport const useRenderer = () => {\n const renderer = useContext(RendererContext)\n\n if (!renderer) {\n throw new Error(\"No renderer found\")\n }\n\n return renderer\n}\n\nexport const onResize = (callback: (width: number, height: number) => void) => {\n const renderer = useRenderer()\n\n onMount(() => {\n renderer.on(\"resize\", callback)\n })\n\n onCleanup(() => {\n renderer.off(\"resize\", callback)\n })\n}\n\nexport const useTerminalDimensions = () => {\n const renderer = useRenderer()\n const [terminalDimensions, setTerminalDimensions] = createSignal<{\n width: number\n height: number\n }>({ width: renderer.width, height: renderer.height })\n\n const callback = (width: number, height: number) => {\n setTerminalDimensions({ width, height })\n }\n\n onResize(callback)\n\n return terminalDimensions\n}\n\nexport interface UseKeyboardOptions {\n /** Include release events - callback receives events with eventType: \"release\" */\n release?: boolean\n}\n\n/**\n * Subscribe to keyboard events.\n *\n * By default, only receives press events (including key repeats with `repeated: true`).\n * Use `options.release` to also receive release events.\n *\n * @example\n * // Basic press handling (includes repeats)\n * useKeyboard((e) => console.log(e.name, e.repeated ? \"(repeat)\" : \"\"))\n *\n * // With release events\n * useKeyboard((e) => {\n * if (e.eventType === \"release\") keys.delete(e.name)\n * else keys.add(e.name)\n * }, { release: true })\n */\nexport const useKeyboard = (callback: (key: KeyEvent) => void, options?: UseKeyboardOptions) => {\n const renderer = useRenderer()\n const keyHandler = renderer.keyInput\n onMount(() => {\n keyHandler.on(\"keypress\", callback)\n if (options?.release) {\n keyHandler.on(\"keyrelease\", callback)\n }\n })\n\n onCleanup(() => {\n keyHandler.off(\"keypress\", callback)\n if (options?.release) {\n keyHandler.off(\"keyrelease\", callback)\n }\n })\n}\n\nexport const usePaste = (callback: (event: PasteEvent) => void) => {\n const renderer = useRenderer()\n const keyHandler = renderer.keyInput\n onMount(() => {\n keyHandler.on(\"paste\", callback)\n })\n\n onCleanup(() => {\n keyHandler.off(\"paste\", callback)\n })\n}\n\n/**\n * @deprecated renamed to useKeyboard\n */\nexport const useKeyHandler = useKeyboard\n\nexport const onFocus = (callback: () => void) => {\n const renderer = useRenderer()\n\n onMount(() => {\n renderer.on(\"focus\", callback)\n })\n\n onCleanup(() => {\n renderer.off(\"focus\", callback)\n })\n}\n\nexport const onBlur = (callback: () => void) => {\n const renderer = useRenderer()\n\n onMount(() => {\n renderer.on(\"blur\", callback)\n })\n\n onCleanup(() => {\n renderer.off(\"blur\", callback)\n })\n}\n\nexport const useSelectionHandler = (callback: (selection: Selection) => void) => {\n const renderer = useRenderer()\n\n onMount(() => {\n renderer.on(\"selection\", callback)\n })\n\n onCleanup(() => {\n renderer.off(\"selection\", callback)\n })\n}\n\nexport const useTimeline = (options: TimelineOptions = {}): Timeline => {\n const timeline = new Timeline(options)\n\n onMount(() => {\n if (options.autoplay !== false) {\n timeline.play()\n }\n engine.register(timeline)\n })\n\n onCleanup(() => {\n timeline.pause()\n engine.unregister(timeline)\n })\n\n return timeline\n}\n",
|
|
8
|
+
"import { createEffect, createMemo, getOwner, onCleanup, runWithOwner, splitProps, untrack } from \"solid-js\"\nimport { createSlotNode, createElement, insert, spread, type DomNode } from \"../reconciler.js\"\nimport type { JSX } from \"../../jsx-runtime.js\"\nimport type { ValidComponent, ComponentProps } from \"solid-js\"\nimport { useRenderer } from \"./hooks.js\"\n\n/**\n * Renders components somewhere else in the DOM\n *\n * Useful for inserting modals and tooltips outside of an cropping layout. If no mount point is given, the portal is inserted on the root renderable; it is wrapped in a `<box>`\n *\n * @description https://docs.solidjs.com/reference/components/portal\n */\nexport function Portal(props: { mount?: DomNode; ref?: (el: {}) => void; children: JSX.Element }): JSX.Element {\n const renderer = useRenderer()\n\n const marker = createSlotNode(),\n mount = () => props.mount || renderer.root,\n owner = getOwner()\n let content: undefined | (() => JSX.Element)\n\n createEffect(\n () => {\n // basically we backdoor into a sort of renderEffect here\n content || (content = runWithOwner(owner, () => createMemo(() => props.children)))\n const el = mount()\n const container = createElement(\"box\"),\n renderRoot = container\n\n Object.defineProperty(container, \"_$host\", {\n get() {\n return marker.parent\n },\n configurable: true,\n })\n insert(renderRoot, content)\n el.add(container)\n props.ref && (props as any).ref(container)\n onCleanup(() => el.remove(container.id))\n },\n undefined,\n { render: true },\n )\n // The reconciler consumes this marker as the runtime representation of the portal JSX node.\n return marker as unknown as JSX.Element\n}\n\nexport type DynamicProps<T extends ValidComponent, P = ComponentProps<T>> = {\n [K in keyof P]: P[K]\n} & {\n component: T | undefined\n}\n\n/**\n * Renders an arbitrary component or element with the given props\n *\n * This is a lower level version of the `Dynamic` component, useful for\n * performance optimizations in libraries. Do not use this unless you know\n * what you are doing.\n * ```typescript\n * const element = () => multiline() ? 'textarea' : 'input';\n * createDynamic(element, { value: value() });\n * ```\n * @description https://docs.solidjs.com/reference/components/dynamic\n */\nexport function createDynamic<T extends ValidComponent>(\n component: () => T | undefined,\n props: ComponentProps<T>,\n): JSX.Element {\n const cached = createMemo<Function | string | undefined>(component)\n return createMemo(() => {\n const component = cached()\n switch (typeof component) {\n case \"function\":\n // if (isDev) Object.assign(component, { [$DEVCOMP]: true })\n return untrack(() => component(props))\n\n case \"string\":\n const el = createElement(component)\n spread(el, props)\n return el\n\n default:\n break\n }\n }) as unknown as JSX.Element\n}\n\n/**\n * Renders an arbitrary custom or native component and passes the other props\n * ```typescript\n * <Dynamic component={multiline() ? 'textarea' : 'input'} value={value()} />\n * ```\n * @description https://docs.solidjs.com/reference/components/dynamic\n */\nexport function Dynamic<T extends ValidComponent>(props: DynamicProps<T>): JSX.Element {\n const [, others] = splitProps(props, [\"component\"])\n return createDynamic(() => props.component, others as ComponentProps<T>)\n}\n",
|
|
9
|
+
"/* @refresh skip */\nimport {\n BaseRenderable,\n createTextAttributes,\n InputRenderable,\n InputRenderableEvents,\n isTextNodeRenderable,\n parseColor,\n Renderable,\n RootTextNodeRenderable,\n ScrollBoxRenderable,\n SelectRenderable,\n SelectRenderableEvents,\n TabSelectRenderable,\n TabSelectRenderableEvents,\n TextNodeRenderable,\n TextRenderable,\n type TextNodeOptions,\n} from \"@opentui/core\"\nimport { decodeHTML } from \"entities\"\nimport { useContext } from \"solid-js\"\nimport { createRenderer } from \"./renderer/index.js\"\nimport { getComponentCatalogue, RendererContext, SlotRenderable } from \"./elements/index.js\"\nimport { getNextId } from \"./utils/id-counter.js\"\nimport { log } from \"./utils/log.js\"\n\nclass TextNode extends TextNodeRenderable {\n public static override fromString(text: string, options: Partial<TextNodeOptions> = {}): TextNode {\n const node = new TextNode(options)\n node.add(text)\n return node\n }\n}\n\nexport type DomNode = BaseRenderable\n\n/**\n * Gets the id of a node, or content if it's a text chunk.\n * Intended for use in logging.\n * @param node The node to get the id of.\n * @returns Log-friendly id of the node.\n */\nconst logId = (node?: DomNode): string | undefined => {\n if (!node) return undefined\n return node.id\n}\n\nconst getNodeChildren = (node: DomNode) => {\n let children\n if (node instanceof TextRenderable) {\n children = node.getTextChildren()\n } else {\n children = node.getChildren()\n }\n return children\n}\n\nfunction _insertNode(parent: DomNode, node: DomNode, anchor?: DomNode): void {\n log(\n \"Inserting node:\",\n logId(node),\n \"into parent:\",\n logId(parent),\n \"with anchor:\",\n logId(anchor),\n node instanceof TextNode,\n )\n\n if (node instanceof SlotRenderable) {\n node.parent = parent\n node = node.getSlotChild(parent)\n }\n\n if (anchor && anchor instanceof SlotRenderable) {\n anchor = anchor.getSlotChild(parent)\n }\n\n if (isTextNodeRenderable(node)) {\n if (!(parent instanceof TextRenderable) && !isTextNodeRenderable(parent)) {\n throw new Error(\n `Orphan text error: \"${node\n .toChunks()\n .map((c) => c.text)\n .join(\"\")}\" must have a <text> as a parent: ${parent.id} above ${node.id}`,\n )\n }\n }\n\n // Renderable nodes\n if (!(parent instanceof BaseRenderable)) {\n console.error(\"[INSERT]\", \"Tried to mount a non base renderable\")\n // Can't be a noop, have to panic\n throw new Error(\"Tried to mount a non base renderable\")\n }\n\n if (!anchor) {\n parent.add(node)\n return\n }\n\n const children = getNodeChildren(parent)\n\n const anchorIndex = children.findIndex((el) => el.id === anchor.id)\n if (anchorIndex === -1) {\n log(\"[INSERT]\", \"Could not find anchor\", logId(parent), logId(anchor), \"[children]\", ...children.map((c) => c.id))\n }\n\n parent.add(node, anchorIndex)\n}\n\nfunction _removeNode(parent: DomNode, node: DomNode): void {\n log(\"Removing node:\", logId(node), \"from parent:\", logId(parent))\n\n let slotParent: SlotRenderable | undefined\n\n if (node instanceof SlotRenderable) {\n slotParent = node\n const slotChild = slotParent.getSlotChildForRemoval(parent)\n if (!slotChild) {\n if (slotParent.parent === parent) {\n slotParent.parent = null\n }\n return\n }\n\n node = slotChild\n }\n\n parent.remove(node.id)\n\n slotParent?.didRemoveSlotChild(parent, node)\n\n process.nextTick(() => {\n if (node instanceof BaseRenderable && !node.parent) {\n node.destroyRecursively()\n return\n }\n })\n}\n\nfunction _createTextNode(value: string | number): TextNode {\n log(\"Creating text node:\", value)\n\n const id = getNextId(\"text-node\")\n\n if (typeof value === \"number\") {\n value = value.toString()\n }\n\n return TextNode.fromString(decodeHTML(value), { id })\n}\n\nexport function createSlotNode(): SlotRenderable {\n const id = getNextId(\"slot-node\")\n log(\"Creating slot node\", id)\n return new SlotRenderable(id)\n}\n\nfunction _getParentNode(childNode: DomNode): DomNode | undefined {\n log(\"Getting parent of node:\", logId(childNode))\n\n let parent = childNode.parent ?? undefined\n if (parent instanceof RootTextNodeRenderable) {\n parent = parent.textParent ?? undefined\n }\n // ScrollBox delegates add/remove to its internal `content` wrapper\n // (scrollbox → wrapper → viewport → content), so children report\n // `content` as their parent. Return the ScrollBox so the identity\n // check in cleanChildren (getParentNode(el) === parent) succeeds.\n const scrollBoxCandidate = parent?.parent?.parent?.parent\n if (scrollBoxCandidate instanceof ScrollBoxRenderable && scrollBoxCandidate.content === parent) {\n parent = scrollBoxCandidate\n }\n return parent\n}\n\nexport const {\n render: _render,\n effect,\n memo,\n createComponent,\n createElement,\n createTextNode,\n insertNode,\n insert,\n spread,\n setProp,\n mergeProps,\n use,\n} = createRenderer<DomNode>({\n createElement(tagName: string): DomNode {\n log(\"Creating element:\", tagName)\n const id = getNextId(tagName)\n const solidRenderer = useContext(RendererContext)\n if (!solidRenderer) {\n throw new Error(\"No renderer found\")\n }\n const elements = getComponentCatalogue()\n\n if (!elements[tagName]) {\n throw new Error(`[Reconciler] Unknown component type: ${tagName}`)\n }\n\n const element = new elements[tagName](solidRenderer, { id })\n log(\"Element created with id:\", id)\n return element\n },\n\n createTextNode: _createTextNode,\n\n createSlotNode,\n\n replaceText(textNode: TextNode, value: string): void {\n log(\"Replacing text:\", value, \"in node:\", logId(textNode))\n\n if (!(textNode instanceof TextNode)) return\n textNode.replace(decodeHTML(value), 0)\n },\n\n setProperty(node: DomNode, name: string, value: any, prev: any): void {\n if (name.startsWith(\"on:\")) {\n const eventName = name.slice(3)\n if (value) {\n node.on(eventName, value)\n }\n if (prev) {\n node.off(eventName, prev)\n }\n\n return\n }\n\n if (isTextNodeRenderable(node)) {\n if (name === \"href\") {\n node.link = { url: value }\n return\n }\n\n if (name === \"style\") {\n node.attributes |= createTextAttributes(value)\n node.fg = value.fg ? parseColor(value.fg) : node.fg\n node.bg = value.bg ? parseColor(value.bg) : node.bg\n return\n }\n\n return\n }\n\n switch (name) {\n case \"id\":\n log(\"Id mapped\", node.id, \"=\", value)\n node[name] = value\n break\n case \"focused\":\n if (!(node instanceof Renderable)) return\n if (value) {\n node.focus()\n } else {\n node.blur()\n }\n break\n case \"onChange\":\n let event: string | undefined = undefined\n if (node instanceof SelectRenderable) {\n event = SelectRenderableEvents.SELECTION_CHANGED\n } else if (node instanceof TabSelectRenderable) {\n event = TabSelectRenderableEvents.SELECTION_CHANGED\n } else if (node instanceof InputRenderable) {\n event = InputRenderableEvents.CHANGE\n }\n if (!event) break\n\n if (value) {\n node.on(event, value)\n }\n if (prev) {\n node.off(event, prev)\n }\n break\n case \"onInput\":\n if (node instanceof InputRenderable) {\n if (value) {\n node.on(InputRenderableEvents.INPUT, value)\n }\n\n if (prev) {\n node.off(InputRenderableEvents.INPUT, prev)\n }\n }\n\n break\n case \"onSubmit\":\n if (node instanceof InputRenderable) {\n if (value) {\n node.on(InputRenderableEvents.ENTER, value)\n }\n\n if (prev) {\n node.off(InputRenderableEvents.ENTER, prev)\n }\n } else {\n // @ts-expect-error todo validate if prop is actually settable\n node[name] = value\n }\n break\n case \"onSelect\":\n if (node instanceof SelectRenderable) {\n if (value) {\n node.on(SelectRenderableEvents.ITEM_SELECTED, value)\n }\n\n if (prev) {\n node.off(SelectRenderableEvents.ITEM_SELECTED, prev)\n }\n } else if (node instanceof TabSelectRenderable) {\n if (value) {\n node.on(TabSelectRenderableEvents.ITEM_SELECTED, value)\n }\n\n if (prev) {\n node.off(TabSelectRenderableEvents.ITEM_SELECTED, prev)\n }\n }\n break\n case \"style\":\n for (const prop in value) {\n const propVal = value[prop]\n if (prev !== undefined && propVal === prev[prop]) continue\n // @ts-expect-error todo validate if prop is actually settable\n node[prop] = propVal\n }\n break\n case \"text\":\n case \"content\": {\n const textValue = typeof value === \"string\" ? value : Array.isArray(value) ? value.join(\"\") : `${value}`\n // @ts-expect-error todo validate if prop is actually settable\n node[name] = decodeHTML(textValue)\n break\n }\n\n default:\n // @ts-expect-error todo validate if prop is actually settable\n node[name] = value\n }\n },\n\n isTextNode(node: DomNode): boolean {\n return node instanceof TextNode\n },\n\n insertNode: _insertNode,\n\n removeNode: _removeNode,\n\n getParentNode: _getParentNode,\n\n getFirstChild(node: DomNode): DomNode | undefined {\n log(\"Getting first child of node:\", logId(node))\n\n const firstChild = getNodeChildren(node)[0]\n\n if (!firstChild) {\n log(\"No first child found for node:\", logId(node))\n return undefined\n }\n\n log(\"First child found:\", logId(firstChild), \"for node:\", logId(node))\n return firstChild\n },\n\n getNextSibling(node: DomNode): DomNode | undefined {\n log(\"Getting next sibling of node:\", logId(node))\n\n const parent = _getParentNode(node)\n if (!parent) {\n log(\"No parent found for node:\", logId(node))\n return undefined\n }\n\n if (node instanceof SlotRenderable) {\n const layoutSlotNode = node.getSlotChildForRemoval(parent)\n if (layoutSlotNode) {\n node = layoutSlotNode\n }\n }\n\n const siblings = getNodeChildren(parent)\n const index = siblings.indexOf(node)\n\n if (index === -1 || index === siblings.length - 1) {\n log(\"No next sibling found for node:\", logId(node))\n return undefined\n }\n\n const nextSibling = siblings[index + 1]\n\n if (!nextSibling) {\n log(\"Next sibling is null for node:\", logId(node))\n return undefined\n }\n\n log(\"Next sibling found:\", logId(nextSibling), \"for node:\", logId(node))\n return nextSibling\n },\n})\n",
|
|
10
|
+
"import { createRoot, createRenderEffect, createMemo, createComponent, untrack, mergeProps } from \"solid-js\"\n\nconst memo = (fn) => createMemo(() => fn())\n\nexport function createRenderer({\n createElement,\n createTextNode,\n createSlotNode,\n isTextNode,\n replaceText,\n insertNode,\n removeNode,\n setProperty,\n getParentNode,\n getFirstChild,\n getNextSibling,\n}) {\n function insert(parent, accessor, marker, initial) {\n if (marker !== undefined && !initial) initial = []\n if (typeof accessor !== \"function\") return insertExpression(parent, accessor, initial, marker)\n createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial)\n }\n function insertExpression(parent, value, current, marker, unwrapArray) {\n while (typeof current === \"function\") current = current()\n if (value === current) return current\n const t = typeof value,\n multi = marker !== undefined\n if (t === \"string\" || t === \"number\") {\n if (t === \"number\") value = value.toString()\n if (multi) {\n let node = current[0]\n if (node && isTextNode(node)) {\n replaceText(node, value)\n } else node = createTextNode(value)\n current = cleanChildren(parent, current, marker, node)\n } else {\n if (current !== \"\" && typeof current === \"string\") {\n replaceText(getFirstChild(parent), (current = value))\n } else {\n cleanChildren(parent, current, marker, createTextNode(value))\n current = value\n }\n }\n } else if (value == null || t === \"boolean\") {\n current = cleanChildren(parent, current, marker)\n } else if (t === \"function\") {\n createRenderEffect(() => {\n let v = value()\n while (typeof v === \"function\") v = v()\n current = insertExpression(parent, v, current, marker)\n })\n return () => current\n } else if (Array.isArray(value)) {\n const array = []\n if (normalizeIncomingArray(array, value, unwrapArray)) {\n createRenderEffect(() => (current = insertExpression(parent, array, current, marker, true)))\n return () => current\n }\n if (array.length === 0) {\n const replacement = cleanChildren(parent, current, marker)\n if (multi) return (current = replacement)\n } else {\n if (Array.isArray(current)) {\n if (current.length === 0) {\n appendNodes(parent, array, marker)\n } else reconcileArrays(parent, current, array)\n } else if (current == null || current === \"\") {\n appendNodes(parent, array)\n } else {\n reconcileArrays(parent, (multi && current) || [getFirstChild(parent)], array)\n }\n }\n current = array\n } else {\n if (Array.isArray(current)) {\n if (multi) return (current = cleanChildren(parent, current, marker, value))\n cleanChildren(parent, current, null, value)\n } else if (current == null || current === \"\" || !getFirstChild(parent)) {\n insertNode(parent, value)\n } else replaceNode(parent, value, getFirstChild(parent))\n current = value\n }\n return current\n }\n function normalizeIncomingArray(normalized, array, unwrap) {\n let dynamic = false\n for (let i = 0, len = array.length; i < len; i++) {\n let item = array[i],\n t\n if (item == null || item === true || item === false);\n else if (Array.isArray(item)) {\n dynamic = normalizeIncomingArray(normalized, item) || dynamic\n } else if ((t = typeof item) === \"string\" || t === \"number\") {\n normalized.push(createTextNode(item))\n } else if (t === \"function\") {\n if (unwrap) {\n while (typeof item === \"function\") item = item()\n dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item]) || dynamic\n } else {\n normalized.push(item)\n dynamic = true\n }\n } else normalized.push(item)\n }\n return dynamic\n }\n function reconcileArrays(parentNode, a, b) {\n let bLength = b.length,\n aEnd = a.length,\n bEnd = bLength,\n aStart = 0,\n bStart = 0,\n after = getNextSibling(a[aEnd - 1]),\n map = null\n while (aStart < aEnd || bStart < bEnd) {\n if (a[aStart] === b[bStart]) {\n aStart++\n bStart++\n continue\n }\n while (a[aEnd - 1] === b[bEnd - 1]) {\n aEnd--\n bEnd--\n }\n if (aEnd === aStart) {\n const node = bEnd < bLength ? (bStart ? getNextSibling(b[bStart - 1]) : b[bEnd - bStart]) : after\n while (bStart < bEnd) insertNode(parentNode, b[bStart++], node)\n } else if (bEnd === bStart) {\n while (aStart < aEnd) {\n if (!map || !map.has(a[aStart])) removeNode(parentNode, a[aStart])\n aStart++\n }\n } else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {\n const node = getNextSibling(a[--aEnd])\n insertNode(parentNode, b[bStart++], getNextSibling(a[aStart++]))\n insertNode(parentNode, b[--bEnd], node)\n a[aEnd] = b[bEnd]\n } else {\n if (!map) {\n map = new Map()\n let i = bStart\n while (i < bEnd) map.set(b[i], i++)\n }\n const index = map.get(a[aStart])\n if (index != null) {\n if (bStart < index && index < bEnd) {\n let i = aStart,\n sequence = 1,\n t\n while (++i < aEnd && i < bEnd) {\n if ((t = map.get(a[i])) == null || t !== index + sequence) break\n sequence++\n }\n if (sequence > index - bStart) {\n const node = a[aStart]\n while (bStart < index) insertNode(parentNode, b[bStart++], node)\n } else replaceNode(parentNode, b[bStart++], a[aStart++])\n } else aStart++\n } else removeNode(parentNode, a[aStart++])\n }\n }\n }\n function cleanChildren(parent, current, marker, replacement) {\n if (marker === undefined) {\n let removed\n while ((removed = getFirstChild(parent))) removeNode(parent, removed)\n replacement && insertNode(parent, replacement)\n return replacement ?? \"\"\n }\n const node = replacement || createSlotNode()\n if (current.length) {\n let inserted = false\n for (let i = current.length - 1; i >= 0; i--) {\n const el = current[i]\n if (node !== el) {\n const isParent = getParentNode(el) === parent\n if (!inserted && !i) isParent ? replaceNode(parent, node, el) : insertNode(parent, node, marker)\n else isParent && removeNode(parent, el)\n } else inserted = true\n }\n } else insertNode(parent, node, marker)\n return [node]\n }\n function appendNodes(parent, array, marker) {\n for (let i = 0, len = array.length; i < len; i++) insertNode(parent, array[i], marker)\n }\n function replaceNode(parent, newNode, oldNode) {\n insertNode(parent, newNode, oldNode)\n removeNode(parent, oldNode)\n }\n function spreadExpression(node, props, prevProps = {}, skipChildren) {\n props || (props = {})\n if (!skipChildren) {\n createRenderEffect(() => (prevProps.children = insertExpression(node, props.children, prevProps.children)))\n }\n createRenderEffect(() => props.ref && props.ref(node))\n createRenderEffect(() => {\n for (const prop in props) {\n if (prop === \"children\" || prop === \"ref\") continue\n const value = props[prop]\n if (value === prevProps[prop]) continue\n setProperty(node, prop, value, prevProps[prop])\n prevProps[prop] = value\n }\n })\n return prevProps\n }\n return {\n render(code, element) {\n let disposer\n createRoot((dispose) => {\n disposer = dispose\n insert(element, code())\n })\n return disposer\n },\n insert,\n spread(node, accessor, skipChildren) {\n if (typeof accessor === \"function\") {\n createRenderEffect((current) => spreadExpression(node, accessor(), current, skipChildren))\n } else spreadExpression(node, accessor, undefined, skipChildren)\n },\n createElement,\n createTextNode,\n insertNode,\n setProp(node, name, value, prev) {\n setProperty(node, name, value, prev)\n return value\n },\n mergeProps,\n effect: createRenderEffect,\n memo,\n createComponent,\n use(fn, element, arg) {\n return untrack(() => fn(element, arg))\n },\n }\n}\n",
|
|
11
|
+
"import { createRenderer as createRendererDX } from \"./universal.js\"\nimport type { RendererOptions, Renderer } from \"./universal.js\"\nimport { mergeProps } from \"solid-js\"\n\nexport type { RendererOptions, Renderer } from \"./universal.js\"\n\nexport function createRenderer<NodeType>(options: RendererOptions<NodeType>): Renderer<NodeType> {\n const renderer = createRendererDX(options)\n renderer.mergeProps = mergeProps\n return renderer\n}\n",
|
|
12
|
+
"const idCounter = new Map<string, number>()\n\nexport function getNextId(elementType: string): string {\n if (!idCounter.has(elementType)) {\n idCounter.set(elementType, 0)\n }\n\n const value = idCounter.get(elementType)! + 1\n idCounter.set(elementType, value)\n return `${elementType}-${value}`\n}\n",
|
|
13
|
+
"export const log = (...args: any[]) => {\n if (process.env.DEBUG) {\n console.log(\"[Reconciler]\", ...args)\n }\n}\n",
|
|
14
|
+
"import { BaseRenderable, isTextNodeRenderable, TextNodeRenderable, TextRenderable, Yoga } from \"@opentui/core\"\n\ntype LayoutNodeProvider = {\n getLayoutNode?: () => Yoga.Node\n}\n\ntype LayoutNodeConstructor = { create?: () => Yoga.Node } | undefined\n\nfunction getLayoutNodeConstructor(parent?: BaseRenderable): LayoutNodeConstructor {\n const parentLayoutNode = (parent as LayoutNodeProvider | undefined)?.getLayoutNode?.()\n return parentLayoutNode?.constructor as LayoutNodeConstructor\n}\n\nfunction createLayoutSlotYogaNode(parentNodeConstructor?: LayoutNodeConstructor): Yoga.Node {\n return parentNodeConstructor?.create?.() ?? Yoga.default.Node.create()\n}\n\nclass SlotBaseRenderable extends BaseRenderable {\n constructor(id: string) {\n super({\n id,\n })\n }\n\n public add(obj: BaseRenderable | unknown, index?: number): number {\n throw new Error(\"Can't add children on an Slot renderable\")\n }\n\n public getChildren(): BaseRenderable[] {\n return []\n }\n\n public remove(id: string): void {}\n\n public insertBefore(obj: BaseRenderable | unknown, anchor: BaseRenderable | unknown): void {\n throw new Error(\"Can't add children on an Slot renderable\")\n }\n\n public getRenderable(id: string): BaseRenderable | undefined {\n return undefined\n }\n\n public getChildrenCount(): number {\n return 0\n }\n\n public requestRender(): void {}\n\n public findDescendantById(id: string): BaseRenderable | undefined {\n return undefined\n }\n}\n\nexport class TextSlotRenderable extends TextNodeRenderable {\n protected slotParent?: SlotRenderable\n protected destroyed: boolean = false\n\n constructor(id: string, parent?: SlotRenderable) {\n super({ id: id })\n this._visible = false\n this.slotParent = parent\n }\n\n public detachFromSlot(): void {\n this.slotParent = undefined\n }\n\n public disposeWithoutSlotCascade(): void {\n if (this.destroyed) {\n return\n }\n\n this.destroyed = true\n this.detachFromSlot()\n }\n\n public override destroy(): void {\n if (this.destroyed) {\n return\n }\n this.destroyed = true\n\n const slotParent = this.slotParent\n this.slotParent = undefined\n\n slotParent?.destroy()\n super.destroy()\n }\n}\n\nexport class LayoutSlotRenderable extends SlotBaseRenderable {\n protected yogaNode: Yoga.Node\n protected slotParent?: SlotRenderable\n protected destroyed: boolean = false\n private yogaNodeConstructor: LayoutNodeConstructor\n private yogaNodeFreed: boolean = false\n\n constructor(id: string, parent?: SlotRenderable, layoutParent?: BaseRenderable) {\n super(id)\n\n this._visible = false\n this.slotParent = parent\n this.yogaNodeConstructor = getLayoutNodeConstructor(layoutParent)\n this.yogaNode = createLayoutSlotYogaNode(this.yogaNodeConstructor)\n this.yogaNode.setDisplay(Yoga.Display.None)\n }\n\n public getLayoutNode(): Yoga.Node {\n return this.yogaNode\n }\n\n public updateFromLayout() {}\n\n public updateLayout() {}\n\n public onRemove() {}\n\n public isCompatibleWith(layoutParent?: BaseRenderable): boolean {\n return this.yogaNodeConstructor === getLayoutNodeConstructor(layoutParent)\n }\n\n public detachFromSlot(): void {\n this.slotParent = undefined\n }\n\n private freeYogaNode(): void {\n if (this.yogaNodeFreed) {\n return\n }\n\n this.yogaNodeFreed = true\n\n try {\n this.yogaNode.free()\n } catch {}\n }\n\n public disposeWithoutSlotCascade(): void {\n if (this.destroyed) {\n return\n }\n\n this.destroyed = true\n this.detachFromSlot()\n this.freeYogaNode()\n }\n\n public override destroy(): void {\n if (this.destroyed) {\n return\n }\n this.destroyed = true\n\n const slotParent = this.slotParent\n this.slotParent = undefined\n\n this.freeYogaNode()\n slotParent?.destroy()\n }\n}\n\nexport class SlotRenderable extends SlotBaseRenderable {\n protected destroyed: boolean = false\n private readonly layoutNodesByParent = new Map<BaseRenderable, LayoutSlotRenderable>()\n private readonly textNodesByParent = new Map<BaseRenderable, TextSlotRenderable>()\n private layoutNodeCount: number = 0\n private textNodeCount: number = 0\n\n constructor(id: string) {\n super(id)\n\n this._visible = false\n }\n\n public get layoutNode(): LayoutSlotRenderable | undefined {\n return this.getCurrentSlotChild(this.layoutNodesByParent)\n }\n\n public get textNode(): TextSlotRenderable | undefined {\n return this.getCurrentSlotChild(this.textNodesByParent)\n }\n\n private isTextSlotParent(parent: BaseRenderable): boolean {\n return isTextNodeRenderable(parent) || parent instanceof TextRenderable\n }\n\n private getCurrentSlotChild<T extends BaseRenderable>(nodesByParent: Map<BaseRenderable, T>): T | undefined {\n for (const node of nodesByParent.values()) {\n if (node.parent) {\n return node\n }\n }\n\n return nodesByParent.values().next().value\n }\n\n private getTextNodeForParent(parent: BaseRenderable): TextSlotRenderable | undefined {\n const mappedNode = this.textNodesByParent.get(parent)\n if (mappedNode) {\n return mappedNode\n }\n\n for (const [mappedParent, textNode] of this.textNodesByParent) {\n if (textNode.parent !== parent) {\n continue\n }\n\n this.textNodesByParent.delete(mappedParent)\n this.textNodesByParent.set(parent, textNode)\n return textNode\n }\n }\n\n private getLayoutNodeForParent(parent: BaseRenderable): LayoutSlotRenderable | undefined {\n const mappedNode = this.layoutNodesByParent.get(parent)\n if (mappedNode) {\n return mappedNode\n }\n\n for (const [mappedParent, layoutNode] of this.layoutNodesByParent) {\n if (layoutNode.parent !== parent) {\n continue\n }\n\n this.layoutNodesByParent.delete(mappedParent)\n this.layoutNodesByParent.set(parent, layoutNode)\n return layoutNode\n }\n }\n\n private takeReusableTextNode(parent: BaseRenderable): TextSlotRenderable | undefined {\n for (const [mappedParent, textNode] of this.textNodesByParent) {\n if (textNode.parent) {\n continue\n }\n\n this.textNodesByParent.delete(mappedParent)\n this.textNodesByParent.set(parent, textNode)\n return textNode\n }\n }\n\n private takeReusableLayoutNode(parent: BaseRenderable): LayoutSlotRenderable | undefined {\n for (const [mappedParent, layoutNode] of this.layoutNodesByParent) {\n if (layoutNode.parent) {\n continue\n }\n\n if (!layoutNode.isCompatibleWith(parent)) {\n continue\n }\n\n this.layoutNodesByParent.delete(mappedParent)\n this.layoutNodesByParent.set(parent, layoutNode)\n return layoutNode\n }\n }\n\n private disposeDetachedTextNodes(): void {\n for (const [parent, textNode] of this.textNodesByParent) {\n if (textNode.parent) {\n continue\n }\n\n this.textNodesByParent.delete(parent)\n textNode.disposeWithoutSlotCascade()\n }\n }\n\n private disposeDetachedIncompatibleLayoutNodes(parent: BaseRenderable): void {\n for (const [mappedParent, layoutNode] of this.layoutNodesByParent) {\n if (layoutNode.parent || layoutNode.isCompatibleWith(parent)) {\n continue\n }\n\n this.layoutNodesByParent.delete(mappedParent)\n layoutNode.disposeWithoutSlotCascade()\n }\n }\n\n // A slot can have multiple placeholder children attached transiently while a\n // move is in flight. Portal host tracking relies on `slot.parent` pointing at\n // one of the still-live hosts, not necessarily the most recently inserted one.\n private getAttachedSlotParent(excludedNode?: BaseRenderable): BaseRenderable | null {\n for (const textNode of this.textNodesByParent.values()) {\n if (textNode !== excludedNode && textNode.parent) {\n return textNode.parent\n }\n }\n\n for (const layoutNode of this.layoutNodesByParent.values()) {\n if (layoutNode !== excludedNode && layoutNode.parent) {\n return layoutNode.parent\n }\n }\n\n return null\n }\n\n private hasOtherAttachedSlotChildren(excludedNode: BaseRenderable): boolean {\n return this.getAttachedSlotParent(excludedNode) !== null\n }\n\n getSlotChild(parent: BaseRenderable) {\n if (this.isTextSlotParent(parent)) {\n const existingTextNode = this.getTextNodeForParent(parent)\n if (existingTextNode) {\n return existingTextNode\n }\n\n const reusableTextNode = this.takeReusableTextNode(parent)\n if (reusableTextNode) {\n return reusableTextNode\n }\n\n this.disposeDetachedIncompatibleLayoutNodes(parent)\n\n const textNode = new TextSlotRenderable(`slot-text-${this.id}-${++this.textNodeCount}`, this)\n this.textNodesByParent.set(parent, textNode)\n return textNode\n }\n\n const existingLayoutNode = this.getLayoutNodeForParent(parent)\n if (existingLayoutNode) {\n return existingLayoutNode\n }\n\n const reusableLayoutNode = this.takeReusableLayoutNode(parent)\n if (reusableLayoutNode) {\n return reusableLayoutNode\n }\n\n this.disposeDetachedTextNodes()\n this.disposeDetachedIncompatibleLayoutNodes(parent)\n\n const layoutNode = new LayoutSlotRenderable(`slot-layout-${this.id}-${++this.layoutNodeCount}`, this, parent)\n this.layoutNodesByParent.set(parent, layoutNode)\n return layoutNode\n }\n\n getSlotChildForRemoval(parent: BaseRenderable): BaseRenderable | undefined {\n if (this.isTextSlotParent(parent)) {\n return this.getTextNodeForParent(parent)\n }\n\n return this.getLayoutNodeForParent(parent)\n }\n\n didRemoveSlotChild(parent: BaseRenderable, child: BaseRenderable): void {\n const hasOtherAttachedSlotChildren = this.hasOtherAttachedSlotChildren(child)\n\n if (\n hasOtherAttachedSlotChildren &&\n child instanceof TextSlotRenderable &&\n this.getTextNodeForParent(parent) === child\n ) {\n this.textNodesByParent.delete(parent)\n child.disposeWithoutSlotCascade()\n }\n\n if (\n hasOtherAttachedSlotChildren &&\n child instanceof LayoutSlotRenderable &&\n this.getLayoutNodeForParent(parent) === child\n ) {\n this.layoutNodesByParent.delete(parent)\n child.disposeWithoutSlotCascade()\n }\n\n if (this.parent === parent) {\n this.parent = this.getAttachedSlotParent(child)\n }\n }\n\n public override destroy(): void {\n if (this.destroyed) {\n return\n }\n this.destroyed = true\n\n const layoutNodes = new Set(this.layoutNodesByParent.values())\n this.layoutNodesByParent.clear()\n for (const layoutNode of layoutNodes) {\n layoutNode.destroy()\n }\n\n const textNodes = new Set(this.textNodesByParent.values())\n this.textNodesByParent.clear()\n for (const textNode of textNodes) {\n textNode.destroy()\n }\n }\n}\n",
|
|
15
|
+
"import {\n BoxRenderable,\n RootRenderable,\n type CliRenderer,\n type Renderable,\n type ScrollbackRenderContext,\n type ScrollbackSnapshot,\n type ScrollbackWriter,\n} from \"@opentui/core\"\nimport { createSignal, type JSX } from \"solid-js\"\nimport { RendererContext } from \"./elements/index.js\"\nimport { _render as renderInternal, createComponent } from \"./reconciler.js\"\n\ntype DisposeFn = () => void\n\ninterface SnapshotRendererBinding {\n renderer: CliRenderer\n getHeight: () => number\n setHeight: (height: number) => void\n}\n\nlet solidScrollbackRootCounter = 0\nconst MAX_AUTO_HEIGHT_PASSES = 4\n\nexport interface SolidScrollbackWriterOptions {\n width?: number\n height?: number\n rowColumns?: number\n startOnNewLine?: boolean\n trailingNewline?: boolean\n}\n\nexport type SolidScrollbackNode = (ctx: ScrollbackRenderContext) => JSX.Element\n\nfunction normalizeSnapshotDimension(value: number | undefined, axis: \"width\" | \"height\"): number | undefined {\n if (value === undefined) {\n return undefined\n }\n\n if (!Number.isFinite(value)) {\n throw new Error(`createScrollbackWriter requires a finite ${axis}`)\n }\n\n return Math.max(1, Math.trunc(value))\n}\n\nfunction createSnapshotRendererValue(\n renderContext: ScrollbackRenderContext[\"renderContext\"],\n root: BoxRenderable,\n width: number,\n height: number,\n firstLineOffset: number,\n): SnapshotRendererBinding {\n const [snapshotWidth] = createSignal(width)\n const [snapshotHeight, setSnapshotHeight] = createSignal(height)\n const renderer = Object.create(renderContext) as CliRenderer\n let offset = firstLineOffset\n\n Object.defineProperties(renderer, {\n root: {\n value: root,\n enumerable: true,\n configurable: true,\n },\n width: {\n get: snapshotWidth,\n enumerable: true,\n configurable: true,\n },\n height: {\n get: snapshotHeight,\n enumerable: true,\n configurable: true,\n },\n claimFirstLineOffset: {\n value: () => {\n const out = offset\n offset = 0\n return out\n },\n enumerable: true,\n configurable: true,\n },\n })\n\n return {\n renderer,\n getHeight: snapshotHeight,\n setHeight(nextHeight: number): void {\n setSnapshotHeight(nextHeight)\n renderer.emit(\"resize\", snapshotWidth(), nextHeight)\n },\n }\n}\n\nfunction runLifecyclePasses(renderContext: ScrollbackRenderContext[\"renderContext\"]): void {\n for (const renderable of renderContext.getLifecyclePasses()) {\n renderable.onLifecyclePass?.call(renderable)\n }\n}\n\nfunction clearLifecyclePasses(renderContext: ScrollbackRenderContext[\"renderContext\"]): void {\n for (const renderable of [...renderContext.getLifecyclePasses()]) {\n renderContext.unregisterLifecyclePass(renderable)\n }\n}\n\nfunction measureSnapshotHeight(renderContext: ScrollbackRenderContext[\"renderContext\"], root: Renderable): number {\n const measureRoot = new RootRenderable(renderContext)\n\n try {\n measureRoot.add(root)\n runLifecyclePasses(renderContext)\n measureRoot.calculateLayout()\n return Math.max(1, Math.trunc(root.getLayoutNode().getComputedLayout().height))\n } finally {\n if (root.parent === measureRoot) {\n measureRoot.remove(root.id)\n }\n measureRoot.destroyRecursively()\n }\n}\n\nfunction resolveSnapshotHeight(\n renderContext: ScrollbackRenderContext[\"renderContext\"],\n root: Renderable,\n snapshotRenderer: SnapshotRendererBinding,\n): number {\n for (let pass = 0; pass < MAX_AUTO_HEIGHT_PASSES; pass++) {\n const measuredHeight = measureSnapshotHeight(renderContext, root)\n\n if (measuredHeight === snapshotRenderer.getHeight()) {\n clearLifecyclePasses(renderContext)\n return measuredHeight\n }\n\n snapshotRenderer.setHeight(measuredHeight)\n }\n\n // Give up on converging the synthetic height and let the final render rerun\n // lifecycle passes against the last consistent tree state.\n return measureSnapshotHeight(renderContext, root)\n}\n\nexport function createScrollbackWriter(\n node: SolidScrollbackNode,\n options: SolidScrollbackWriterOptions = {},\n): ScrollbackWriter {\n return (ctx: ScrollbackRenderContext): ScrollbackSnapshot => {\n const width = normalizeSnapshotDimension(options.width, \"width\") ?? Math.max(1, Math.trunc(ctx.width))\n const height = normalizeSnapshotDimension(options.height, \"height\")\n const startOnNewLine = options.startOnNewLine ?? true\n const firstLineWidth =\n !startOnNewLine && ctx.tailColumn > 0 && ctx.tailColumn < ctx.width\n ? Math.min(width, ctx.width - ctx.tailColumn)\n : width\n const firstLineOffset = width - firstLineWidth\n const root = new BoxRenderable(ctx.renderContext, {\n id: `solid-scrollback-root-${solidScrollbackRootCounter++}`,\n position: \"absolute\",\n left: 0,\n top: 0,\n width,\n height: height ?? \"auto\",\n border: false,\n backgroundColor: \"transparent\",\n shouldFill: false,\n flexDirection: \"column\",\n })\n const snapshotRenderer = createSnapshotRendererValue(\n ctx.renderContext,\n root,\n width,\n height ?? Math.max(1, ctx.renderContext.height),\n firstLineOffset,\n )\n\n let dispose: DisposeFn | undefined\n let disposed = false\n\n const teardown = () => {\n if (disposed) {\n return\n }\n\n disposed = true\n dispose?.()\n }\n\n try {\n dispose = renderInternal(\n () =>\n createComponent(RendererContext.Provider, {\n get value() {\n return snapshotRenderer.renderer\n },\n get children() {\n return node(ctx)\n },\n }),\n root,\n )\n\n return {\n root,\n width,\n height: height ?? resolveSnapshotHeight(ctx.renderContext, root, snapshotRenderer),\n rowColumns: options.rowColumns,\n startOnNewLine,\n trailingNewline: options.trailingNewline,\n teardown,\n }\n } catch (error) {\n teardown()\n root.destroyRecursively()\n throw error\n }\n }\n}\n\nexport function writeSolidToScrollback(\n renderer: CliRenderer,\n node: SolidScrollbackNode,\n options: SolidScrollbackWriterOptions = {},\n): void {\n renderer.writeToScrollback(createScrollbackWriter(node, options))\n}\n",
|
|
16
|
+
"import { spread as _$spread } from \"@opentui/solid\";\nimport { createElement as _$createElement } from \"@opentui/solid\";\nimport { TimeToFirstDrawRenderable } from \"@opentui/core\";\nimport { extend } from \"./elements/index.js\";\nextend({\n time_to_first_draw: TimeToFirstDrawRenderable\n});\nexport const TimeToFirstDraw = props => {\n return (() => {\n var _el$ = _$createElement(\"time_to_first_draw\");\n _$spread(_el$, props, false);\n return _el$;\n })();\n};",
|
|
17
|
+
"import { memo as _$memo } from \"@opentui/solid\";\nimport { createComponent as _$createComponent } from \"@opentui/solid\";\nimport { mergeProps as _$mergeProps } from \"@opentui/solid\";\nimport { createSlotRegistry } from \"@opentui/core\";\nimport { children, createMemo, createSignal, ErrorBoundary, For, onCleanup, splitProps } from \"solid-js\";\nconst EMPTY_ENTRY_IDS = [];\nexport function createSolidSlotRegistry(renderer, context, options = {}) {\n // Solid slots intentionally use one registry key per renderer instance.\n // Use createSlotRegistry from @opentui/core with a custom key for independent registries.\n return createSlotRegistry(renderer, \"solid:slot-registry\", context, options);\n}\nexport function createSlot(registry, options = {}) {\n return function BoundSlot(props) {\n return _$createComponent(Slot, _$mergeProps(props, {\n registry: registry,\n get pluginFailurePlaceholder() {\n return options.pluginFailurePlaceholder;\n }\n }));\n };\n}\nexport function Slot(props) {\n const [local, slotProps] = splitProps(props, [\"registry\", \"name\", \"mode\", \"children\", \"pluginFailurePlaceholder\"]);\n const registry = () => local.registry;\n const pluginFailurePlaceholder = () => local.pluginFailurePlaceholder;\n const [version, setVersion] = createSignal(0);\n let queued = false;\n let disposed = false;\n const unsubscribe = registry().subscribe(() => {\n if (queued) return;\n queued = true;\n setVersion(current => current + 1);\n queueMicrotask(() => {\n queued = false;\n if (disposed) return;\n });\n });\n onCleanup(() => {\n disposed = true;\n unsubscribe();\n });\n const entries = createMemo((previousEntries = []) => {\n version();\n const resolvedEntries = registry().resolveEntries(local.name);\n if (resolvedEntries.length === 0) {\n if (previousEntries.length === 0) return previousEntries;\n return [];\n }\n const previousById = new Map(previousEntries.map(entry => [entry.id, entry]));\n const nextEntries = resolvedEntries.map(entry => {\n const previousEntry = previousById.get(entry.id);\n if (previousEntry && previousEntry.renderer === entry.renderer) {\n return previousEntry;\n }\n return entry;\n });\n const unchanged = nextEntries.length === previousEntries.length && nextEntries.every((entry, index) => entry === previousEntries[index]);\n if (unchanged) return previousEntries;\n return nextEntries;\n });\n const entryIds = createMemo(() => entries().map(entry => entry.id));\n const entriesById = createMemo(() => new Map(entries().map(entry => [entry.id, entry])));\n const slotName = () => String(local.name);\n const renderFallback = () => {\n const value = children(() => local.children)();\n return value ?? null;\n };\n const resolveFallback = fallbackValue => fallbackValue?.() ?? null;\n const renderPluginFailurePlaceholder = (failure, fallbackValue) => {\n if (!pluginFailurePlaceholder()) {\n return resolveFallback(fallbackValue);\n }\n try {\n return pluginFailurePlaceholder()(failure);\n } catch (error) {\n registry().reportPluginError({\n pluginId: failure.pluginId,\n slot: failure.slot ?? slotName(),\n phase: \"error_placeholder\",\n source: \"solid\",\n error\n });\n return resolveFallback(fallbackValue);\n }\n };\n const renderEntry = (entry, fallbackOnError) => {\n let initialRender;\n try {\n initialRender = entry.renderer(registry().context, slotProps);\n } catch (error) {\n const failure = registry().reportPluginError({\n pluginId: entry.id,\n slot: slotName(),\n phase: \"render\",\n source: \"solid\",\n error\n });\n return renderPluginFailurePlaceholder(failure, fallbackOnError);\n }\n const resolvedInitialRender = children(() => initialRender);\n const hasInitialOutput = resolvedInitialRender.toArray().some(node => node !== null && node !== undefined && node !== false);\n if (!hasInitialOutput) {\n return resolveFallback(fallbackOnError);\n }\n return _$createComponent(ErrorBoundary, {\n fallback: error => {\n const failure = registry().reportPluginError({\n pluginId: entry.id,\n slot: slotName(),\n phase: \"render\",\n source: \"solid\",\n error\n });\n return renderPluginFailurePlaceholder(failure, fallbackOnError);\n },\n get children() {\n return resolvedInitialRender();\n }\n });\n };\n const AppendEntry = appendProps => {\n const entry = createMemo(() => entriesById().get(appendProps.entryId));\n return _$memo(() => {\n const resolvedEntry = entry();\n if (!resolvedEntry) {\n return null;\n }\n return renderEntry(resolvedEntry);\n });\n };\n const appendEntryIds = createMemo(() => {\n const mode = local.mode ?? \"append\";\n if (mode !== \"append\") {\n return EMPTY_ENTRY_IDS;\n }\n return entryIds();\n });\n const appendView = [renderFallback, _$createComponent(For, {\n get each() {\n return appendEntryIds();\n },\n children: entryId => _$createComponent(AppendEntry, {\n entryId: entryId\n })\n })];\n return _$memo(() => {\n const resolvedEntries = entries();\n const mode = local.mode ?? \"append\";\n if (resolvedEntries.length === 0) {\n return renderFallback();\n }\n if (mode === \"single_winner\") {\n const winner = resolvedEntries[0];\n if (!winner) {\n return renderFallback();\n }\n return renderEntry(winner, renderFallback);\n }\n if (mode === \"replace\") {\n const renderedEntries = resolvedEntries.map(entry => renderEntry(entry));\n const hasPluginOutput = renderedEntries.some(entry => entry !== null && entry !== undefined && entry !== false);\n if (!hasPluginOutput) {\n return renderFallback();\n }\n return renderedEntries;\n }\n return appendView;\n });\n}"
|
|
18
|
+
],
|
|
19
|
+
"mappings": ";;AAAA,mDAAyC;AACzC;;;ACDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA,MAAM,uBAAuB,mBAAmB;AAAA,EAE3B;AAAA,EADnB,WAAW,CACQ,MACjB,SACA;AAAA,IACA,MAAM,OAAO;AAAA,IAHI;AAAA;AAKrB;AAEO,IAAM,eAAe,CAAC,QAAQ,KAAK,UAAU,KAAK,MAAM,KAAK,GAAG;AAAA;AAGvE,MAAM,+BAA+B,eAAe;AAAA,EAClD,WAAW,CAAC,SAAc,UAAwB;AAAA,IAChD,MAAM,MAAM,OAAO;AAAA,IAGnB,IAAI,aAAa,OAAO,aAAa,UAAU;AAAA,MAC7C,KAAK,cAAc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Renderer, type CliRendererConfig } from "@opentui/core";
|
|
2
2
|
import { type TestRendererOptions } from "@opentui/core/testing";
|
|
3
|
-
import type { JSX } from "./jsx-runtime";
|
|
3
|
+
import type { JSX } from "./jsx-runtime.js";
|
|
4
4
|
export declare const render: (node: () => JSX.Element, rendererOrConfig?: CliRenderer | CliRendererConfig) => Promise<void>;
|
|
5
5
|
export declare const testRender: (node: () => JSX.Element, renderConfig?: TestRendererOptions) => Promise<import("@opentui/core/testing").TestRendererSetup>;
|
|
6
6
|
export * from "./src/reconciler.js";
|
package/index.js
CHANGED
|
@@ -1,26 +1,105 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
BoldSpanRenderable,
|
|
4
|
-
ItalicSpanRenderable,
|
|
5
|
-
LineBreakRenderable,
|
|
6
|
-
LinkRenderable,
|
|
7
|
-
UnderlineSpanRenderable,
|
|
8
|
-
baseComponents,
|
|
9
|
-
componentCatalogue,
|
|
10
|
-
extend,
|
|
11
|
-
getComponentCatalogue,
|
|
12
|
-
textNodeKeys
|
|
13
|
-
} from "./chunk-7fkmdv3h.js";
|
|
14
|
-
|
|
15
1
|
// index.ts
|
|
16
2
|
import { CliRenderer, createCliRenderer, engine as engine2 } from "@opentui/core";
|
|
17
3
|
import { createTestRenderer } from "@opentui/core/testing";
|
|
4
|
+
|
|
5
|
+
// src/elements/catalogue.ts
|
|
6
|
+
import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, DiffRenderable, InputRenderable, LineNumberRenderable, MarkdownRenderable, ScrollBoxRenderable, SelectRenderable, TabSelectRenderable, TextareaRenderable, TextAttributes, TextNodeRenderable, TextRenderable } from "@opentui/core";
|
|
7
|
+
|
|
8
|
+
class SpanRenderable extends TextNodeRenderable {
|
|
9
|
+
constructor(_ctx, options) {
|
|
10
|
+
super(options);
|
|
11
|
+
this._ctx = _ctx;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
var textNodeKeys = ["span", "b", "strong", "i", "em", "u", "a"];
|
|
15
|
+
|
|
16
|
+
class TextModifierRenderable extends SpanRenderable {
|
|
17
|
+
constructor(options, modifier) {
|
|
18
|
+
super(null, options);
|
|
19
|
+
if (modifier === "b" || modifier === "strong") {
|
|
20
|
+
this.attributes = (this.attributes || 0) | TextAttributes.BOLD;
|
|
21
|
+
} else if (modifier === "i" || modifier === "em") {
|
|
22
|
+
this.attributes = (this.attributes || 0) | TextAttributes.ITALIC;
|
|
23
|
+
} else if (modifier === "u") {
|
|
24
|
+
this.attributes = (this.attributes || 0) | TextAttributes.UNDERLINE;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class BoldSpanRenderable extends TextModifierRenderable {
|
|
30
|
+
constructor(options) {
|
|
31
|
+
super(options, "b");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
class ItalicSpanRenderable extends TextModifierRenderable {
|
|
36
|
+
constructor(options) {
|
|
37
|
+
super(options, "i");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
class UnderlineSpanRenderable extends TextModifierRenderable {
|
|
42
|
+
constructor(options) {
|
|
43
|
+
super(options, "u");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class LineBreakRenderable extends SpanRenderable {
|
|
48
|
+
constructor(_ctx, options) {
|
|
49
|
+
super(null, options);
|
|
50
|
+
this.add();
|
|
51
|
+
}
|
|
52
|
+
add() {
|
|
53
|
+
return super.add(`
|
|
54
|
+
`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
class LinkRenderable extends SpanRenderable {
|
|
59
|
+
constructor(_ctx, options) {
|
|
60
|
+
const linkOptions = {
|
|
61
|
+
...options,
|
|
62
|
+
link: {
|
|
63
|
+
url: options.href
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
super(null, linkOptions);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var baseComponents = {
|
|
70
|
+
box: BoxRenderable,
|
|
71
|
+
text: TextRenderable,
|
|
72
|
+
input: InputRenderable,
|
|
73
|
+
select: SelectRenderable,
|
|
74
|
+
textarea: TextareaRenderable,
|
|
75
|
+
ascii_font: ASCIIFontRenderable,
|
|
76
|
+
tab_select: TabSelectRenderable,
|
|
77
|
+
scrollbox: ScrollBoxRenderable,
|
|
78
|
+
code: CodeRenderable,
|
|
79
|
+
diff: DiffRenderable,
|
|
80
|
+
line_number: LineNumberRenderable,
|
|
81
|
+
markdown: MarkdownRenderable,
|
|
82
|
+
span: SpanRenderable,
|
|
83
|
+
strong: BoldSpanRenderable,
|
|
84
|
+
b: BoldSpanRenderable,
|
|
85
|
+
em: ItalicSpanRenderable,
|
|
86
|
+
i: ItalicSpanRenderable,
|
|
87
|
+
u: UnderlineSpanRenderable,
|
|
88
|
+
br: LineBreakRenderable,
|
|
89
|
+
a: LinkRenderable
|
|
90
|
+
};
|
|
91
|
+
var componentCatalogue = {
|
|
92
|
+
...baseComponents
|
|
93
|
+
};
|
|
94
|
+
function extend(objects) {
|
|
95
|
+
Object.assign(componentCatalogue, objects);
|
|
96
|
+
}
|
|
97
|
+
function getComponentCatalogue() {
|
|
98
|
+
return componentCatalogue;
|
|
99
|
+
}
|
|
18
100
|
// src/elements/hooks.ts
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
Timeline
|
|
22
|
-
} from "@opentui/core";
|
|
23
|
-
import { createContext, createSignal, onCleanup, onMount, useContext } from "solid-js";
|
|
101
|
+
import { engine, Timeline } from "@opentui/core";
|
|
102
|
+
import { createContext, createSignal, onCleanup, onMount, useContext } from "solid-js/dist/solid.js";
|
|
24
103
|
var RendererContext = createContext();
|
|
25
104
|
var useRenderer = () => {
|
|
26
105
|
const renderer = useContext(RendererContext);
|
|
@@ -40,9 +119,15 @@ var onResize = (callback) => {
|
|
|
40
119
|
};
|
|
41
120
|
var useTerminalDimensions = () => {
|
|
42
121
|
const renderer = useRenderer();
|
|
43
|
-
const [terminalDimensions, setTerminalDimensions] = createSignal({
|
|
122
|
+
const [terminalDimensions, setTerminalDimensions] = createSignal({
|
|
123
|
+
width: renderer.width,
|
|
124
|
+
height: renderer.height
|
|
125
|
+
});
|
|
44
126
|
const callback = (width, height) => {
|
|
45
|
-
setTerminalDimensions({
|
|
127
|
+
setTerminalDimensions({
|
|
128
|
+
width,
|
|
129
|
+
height
|
|
130
|
+
});
|
|
46
131
|
};
|
|
47
132
|
onResize(callback);
|
|
48
133
|
return terminalDimensions;
|
|
@@ -116,31 +201,15 @@ var useTimeline = (options = {}) => {
|
|
|
116
201
|
return timeline;
|
|
117
202
|
};
|
|
118
203
|
// src/elements/extras.ts
|
|
119
|
-
import { createEffect, createMemo as createMemo2, getOwner, onCleanup as onCleanup2, runWithOwner, splitProps, untrack as untrack2 } from "solid-js";
|
|
204
|
+
import { createEffect, createMemo as createMemo2, getOwner, onCleanup as onCleanup2, runWithOwner, splitProps, untrack as untrack2 } from "solid-js/dist/solid.js";
|
|
120
205
|
|
|
121
206
|
// src/reconciler.ts
|
|
122
|
-
import {
|
|
123
|
-
BaseRenderable,
|
|
124
|
-
createTextAttributes,
|
|
125
|
-
InputRenderable,
|
|
126
|
-
InputRenderableEvents,
|
|
127
|
-
isTextNodeRenderable,
|
|
128
|
-
parseColor,
|
|
129
|
-
Renderable,
|
|
130
|
-
RootTextNodeRenderable,
|
|
131
|
-
ScrollBoxRenderable,
|
|
132
|
-
SelectRenderable,
|
|
133
|
-
SelectRenderableEvents,
|
|
134
|
-
TabSelectRenderable,
|
|
135
|
-
TabSelectRenderableEvents,
|
|
136
|
-
TextNodeRenderable,
|
|
137
|
-
TextRenderable
|
|
138
|
-
} from "@opentui/core";
|
|
207
|
+
import { BaseRenderable, createTextAttributes, InputRenderable as InputRenderable2, InputRenderableEvents, isTextNodeRenderable, parseColor, Renderable, RootTextNodeRenderable, ScrollBoxRenderable as ScrollBoxRenderable2, SelectRenderable as SelectRenderable2, SelectRenderableEvents, TabSelectRenderable as TabSelectRenderable2, TabSelectRenderableEvents, TextNodeRenderable as TextNodeRenderable2, TextRenderable as TextRenderable2 } from "@opentui/core";
|
|
139
208
|
import { decodeHTML } from "entities";
|
|
140
|
-
import { useContext as useContext2 } from "solid-js";
|
|
209
|
+
import { useContext as useContext2 } from "solid-js/dist/solid.js";
|
|
141
210
|
|
|
142
211
|
// src/renderer/universal.js
|
|
143
|
-
import { createRoot, createRenderEffect, createMemo, createComponent, untrack, mergeProps } from "solid-js";
|
|
212
|
+
import { createRoot, createRenderEffect, createMemo, createComponent, untrack, mergeProps } from "solid-js/dist/solid.js";
|
|
144
213
|
var memo = (fn) => createMemo(() => fn());
|
|
145
214
|
function createRenderer({
|
|
146
215
|
createElement,
|
|
@@ -399,7 +468,7 @@ function createRenderer({
|
|
|
399
468
|
}
|
|
400
469
|
|
|
401
470
|
// src/renderer/index.ts
|
|
402
|
-
import { mergeProps as mergeProps2 } from "solid-js";
|
|
471
|
+
import { mergeProps as mergeProps2 } from "solid-js/dist/solid.js";
|
|
403
472
|
function createRenderer2(options) {
|
|
404
473
|
const renderer = createRenderer(options);
|
|
405
474
|
renderer.mergeProps = mergeProps2;
|
|
@@ -425,7 +494,7 @@ var log = (...args) => {
|
|
|
425
494
|
};
|
|
426
495
|
|
|
427
496
|
// src/reconciler.ts
|
|
428
|
-
class TextNode extends
|
|
497
|
+
class TextNode extends TextNodeRenderable2 {
|
|
429
498
|
static fromString(text, options = {}) {
|
|
430
499
|
const node = new TextNode(options);
|
|
431
500
|
node.add(text);
|
|
@@ -439,7 +508,7 @@ var logId = (node) => {
|
|
|
439
508
|
};
|
|
440
509
|
var getNodeChildren = (node) => {
|
|
441
510
|
let children;
|
|
442
|
-
if (node instanceof
|
|
511
|
+
if (node instanceof TextRenderable2) {
|
|
443
512
|
children = node.getTextChildren();
|
|
444
513
|
} else {
|
|
445
514
|
children = node.getChildren();
|
|
@@ -456,7 +525,7 @@ function _insertNode(parent, node, anchor) {
|
|
|
456
525
|
anchor = anchor.getSlotChild(parent);
|
|
457
526
|
}
|
|
458
527
|
if (isTextNodeRenderable(node)) {
|
|
459
|
-
if (!(parent instanceof
|
|
528
|
+
if (!(parent instanceof TextRenderable2) && !isTextNodeRenderable(parent)) {
|
|
460
529
|
throw new Error(`Orphan text error: "${node.toChunks().map((c) => c.text).join("")}" must have a <text> as a parent: ${parent.id} above ${node.id}`);
|
|
461
530
|
}
|
|
462
531
|
}
|
|
@@ -504,7 +573,9 @@ function _createTextNode(value) {
|
|
|
504
573
|
if (typeof value === "number") {
|
|
505
574
|
value = value.toString();
|
|
506
575
|
}
|
|
507
|
-
return TextNode.fromString(decodeHTML(value), {
|
|
576
|
+
return TextNode.fromString(decodeHTML(value), {
|
|
577
|
+
id
|
|
578
|
+
});
|
|
508
579
|
}
|
|
509
580
|
function createSlotNode() {
|
|
510
581
|
const id = getNextId("slot-node");
|
|
@@ -518,7 +589,7 @@ function _getParentNode(childNode) {
|
|
|
518
589
|
parent = parent.textParent ?? undefined;
|
|
519
590
|
}
|
|
520
591
|
const scrollBoxCandidate = parent?.parent?.parent?.parent;
|
|
521
|
-
if (scrollBoxCandidate instanceof
|
|
592
|
+
if (scrollBoxCandidate instanceof ScrollBoxRenderable2 && scrollBoxCandidate.content === parent) {
|
|
522
593
|
parent = scrollBoxCandidate;
|
|
523
594
|
}
|
|
524
595
|
return parent;
|
|
@@ -548,7 +619,9 @@ var {
|
|
|
548
619
|
if (!elements[tagName]) {
|
|
549
620
|
throw new Error(`[Reconciler] Unknown component type: ${tagName}`);
|
|
550
621
|
}
|
|
551
|
-
const element = new elements[tagName](solidRenderer, {
|
|
622
|
+
const element = new elements[tagName](solidRenderer, {
|
|
623
|
+
id
|
|
624
|
+
});
|
|
552
625
|
log("Element created with id:", id);
|
|
553
626
|
return element;
|
|
554
627
|
},
|
|
@@ -573,7 +646,9 @@ var {
|
|
|
573
646
|
}
|
|
574
647
|
if (isTextNodeRenderable(node)) {
|
|
575
648
|
if (name === "href") {
|
|
576
|
-
node.link = {
|
|
649
|
+
node.link = {
|
|
650
|
+
url: value
|
|
651
|
+
};
|
|
577
652
|
return;
|
|
578
653
|
}
|
|
579
654
|
if (name === "style") {
|
|
@@ -600,11 +675,11 @@ var {
|
|
|
600
675
|
break;
|
|
601
676
|
case "onChange":
|
|
602
677
|
let event = undefined;
|
|
603
|
-
if (node instanceof
|
|
678
|
+
if (node instanceof SelectRenderable2) {
|
|
604
679
|
event = SelectRenderableEvents.SELECTION_CHANGED;
|
|
605
|
-
} else if (node instanceof
|
|
680
|
+
} else if (node instanceof TabSelectRenderable2) {
|
|
606
681
|
event = TabSelectRenderableEvents.SELECTION_CHANGED;
|
|
607
|
-
} else if (node instanceof
|
|
682
|
+
} else if (node instanceof InputRenderable2) {
|
|
608
683
|
event = InputRenderableEvents.CHANGE;
|
|
609
684
|
}
|
|
610
685
|
if (!event)
|
|
@@ -617,7 +692,7 @@ var {
|
|
|
617
692
|
}
|
|
618
693
|
break;
|
|
619
694
|
case "onInput":
|
|
620
|
-
if (node instanceof
|
|
695
|
+
if (node instanceof InputRenderable2) {
|
|
621
696
|
if (value) {
|
|
622
697
|
node.on(InputRenderableEvents.INPUT, value);
|
|
623
698
|
}
|
|
@@ -627,7 +702,7 @@ var {
|
|
|
627
702
|
}
|
|
628
703
|
break;
|
|
629
704
|
case "onSubmit":
|
|
630
|
-
if (node instanceof
|
|
705
|
+
if (node instanceof InputRenderable2) {
|
|
631
706
|
if (value) {
|
|
632
707
|
node.on(InputRenderableEvents.ENTER, value);
|
|
633
708
|
}
|
|
@@ -639,14 +714,14 @@ var {
|
|
|
639
714
|
}
|
|
640
715
|
break;
|
|
641
716
|
case "onSelect":
|
|
642
|
-
if (node instanceof
|
|
717
|
+
if (node instanceof SelectRenderable2) {
|
|
643
718
|
if (value) {
|
|
644
719
|
node.on(SelectRenderableEvents.ITEM_SELECTED, value);
|
|
645
720
|
}
|
|
646
721
|
if (prev) {
|
|
647
722
|
node.off(SelectRenderableEvents.ITEM_SELECTED, prev);
|
|
648
723
|
}
|
|
649
|
-
} else if (node instanceof
|
|
724
|
+
} else if (node instanceof TabSelectRenderable2) {
|
|
650
725
|
if (value) {
|
|
651
726
|
node.on(TabSelectRenderableEvents.ITEM_SELECTED, value);
|
|
652
727
|
}
|
|
@@ -737,7 +812,9 @@ function Portal(props) {
|
|
|
737
812
|
el.add(container);
|
|
738
813
|
props.ref && props.ref(container);
|
|
739
814
|
onCleanup2(() => el.remove(container.id));
|
|
740
|
-
}, undefined, {
|
|
815
|
+
}, undefined, {
|
|
816
|
+
render: true
|
|
817
|
+
});
|
|
741
818
|
return marker;
|
|
742
819
|
}
|
|
743
820
|
function createDynamic(component, props) {
|
|
@@ -761,7 +838,7 @@ function Dynamic(props) {
|
|
|
761
838
|
return createDynamic(() => props.component, others);
|
|
762
839
|
}
|
|
763
840
|
// src/elements/slot.ts
|
|
764
|
-
import { BaseRenderable as BaseRenderable2, isTextNodeRenderable as isTextNodeRenderable2, TextNodeRenderable as
|
|
841
|
+
import { BaseRenderable as BaseRenderable2, isTextNodeRenderable as isTextNodeRenderable2, TextNodeRenderable as TextNodeRenderable3, TextRenderable as TextRenderable3, Yoga } from "@opentui/core";
|
|
765
842
|
function getLayoutNodeConstructor(parent) {
|
|
766
843
|
const parentLayoutNode = parent?.getLayoutNode?.();
|
|
767
844
|
return parentLayoutNode?.constructor;
|
|
@@ -798,11 +875,12 @@ class SlotBaseRenderable extends BaseRenderable2 {
|
|
|
798
875
|
}
|
|
799
876
|
}
|
|
800
877
|
|
|
801
|
-
class TextSlotRenderable extends
|
|
802
|
-
slotParent;
|
|
878
|
+
class TextSlotRenderable extends TextNodeRenderable3 {
|
|
803
879
|
destroyed = false;
|
|
804
880
|
constructor(id, parent) {
|
|
805
|
-
super({
|
|
881
|
+
super({
|
|
882
|
+
id
|
|
883
|
+
});
|
|
806
884
|
this._visible = false;
|
|
807
885
|
this.slotParent = parent;
|
|
808
886
|
}
|
|
@@ -829,10 +907,7 @@ class TextSlotRenderable extends TextNodeRenderable2 {
|
|
|
829
907
|
}
|
|
830
908
|
|
|
831
909
|
class LayoutSlotRenderable extends SlotBaseRenderable {
|
|
832
|
-
yogaNode;
|
|
833
|
-
slotParent;
|
|
834
910
|
destroyed = false;
|
|
835
|
-
yogaNodeConstructor;
|
|
836
911
|
yogaNodeFreed = false;
|
|
837
912
|
constructor(id, parent, layoutParent) {
|
|
838
913
|
super(id);
|
|
@@ -900,7 +975,7 @@ class SlotRenderable extends SlotBaseRenderable {
|
|
|
900
975
|
return this.getCurrentSlotChild(this.textNodesByParent);
|
|
901
976
|
}
|
|
902
977
|
isTextSlotParent(parent) {
|
|
903
|
-
return isTextNodeRenderable2(parent) || parent instanceof
|
|
978
|
+
return isTextNodeRenderable2(parent) || parent instanceof TextRenderable3;
|
|
904
979
|
}
|
|
905
980
|
getCurrentSlotChild(nodesByParent) {
|
|
906
981
|
for (const node of nodesByParent.values()) {
|
|
@@ -1062,11 +1137,8 @@ class SlotRenderable extends SlotBaseRenderable {
|
|
|
1062
1137
|
}
|
|
1063
1138
|
}
|
|
1064
1139
|
// src/scrollback.ts
|
|
1065
|
-
import {
|
|
1066
|
-
|
|
1067
|
-
RootRenderable
|
|
1068
|
-
} from "@opentui/core";
|
|
1069
|
-
import { createSignal as createSignal2 } from "solid-js";
|
|
1140
|
+
import { BoxRenderable as BoxRenderable2, RootRenderable } from "@opentui/core";
|
|
1141
|
+
import { createSignal as createSignal2 } from "solid-js/dist/solid.js";
|
|
1070
1142
|
var solidScrollbackRootCounter = 0;
|
|
1071
1143
|
var MAX_AUTO_HEIGHT_PASSES = 4;
|
|
1072
1144
|
function normalizeSnapshotDimension(value, axis) {
|
|
@@ -1160,7 +1232,7 @@ function createScrollbackWriter(node, options = {}) {
|
|
|
1160
1232
|
const startOnNewLine = options.startOnNewLine ?? true;
|
|
1161
1233
|
const firstLineWidth = !startOnNewLine && ctx.tailColumn > 0 && ctx.tailColumn < ctx.width ? Math.min(width, ctx.width - ctx.tailColumn) : width;
|
|
1162
1234
|
const firstLineOffset = width - firstLineWidth;
|
|
1163
|
-
const root = new
|
|
1235
|
+
const root = new BoxRenderable2(ctx.renderContext, {
|
|
1164
1236
|
id: `solid-scrollback-root-${solidScrollbackRootCounter++}`,
|
|
1165
1237
|
position: "absolute",
|
|
1166
1238
|
left: 0,
|
|
@@ -1224,7 +1296,7 @@ var TimeToFirstDraw = (props) => {
|
|
|
1224
1296
|
};
|
|
1225
1297
|
// src/plugins/slot.tsx
|
|
1226
1298
|
import { createSlotRegistry } from "@opentui/core";
|
|
1227
|
-
import { children, createMemo as createMemo3, createSignal as createSignal3, ErrorBoundary, For, onCleanup as onCleanup3, splitProps as splitProps2 } from "solid-js";
|
|
1299
|
+
import { children, createMemo as createMemo3, createSignal as createSignal3, ErrorBoundary, For, onCleanup as onCleanup3, splitProps as splitProps2 } from "solid-js/dist/solid.js";
|
|
1228
1300
|
var EMPTY_ENTRY_IDS = [];
|
|
1229
1301
|
function createSolidSlotRegistry(renderer, context, options = {}) {
|
|
1230
1302
|
return createSlotRegistry(renderer, "solid:slot-registry", context, options);
|
|
@@ -1510,3 +1582,5 @@ export {
|
|
|
1510
1582
|
Dynamic,
|
|
1511
1583
|
BoldSpanRenderable
|
|
1512
1584
|
};
|
|
1585
|
+
|
|
1586
|
+
//# debugId=11EF7868D3A4CD2A64756E2164756E21
|