UNPKG

pomljs

Version:

Prompt Orchestration Markup Language

1 lines 31.9 kB
{"version":3,"file":"presentation.cjs","sources":["../.build/presentation.js"],"sourcesContent":["/**\n * NOTE: The components in this file are the lowest-level APIs and for internal use only.\n *\n * There are two main ways to present data: as markup or as serialized data.\n * 1. Markup is to be rendered as markup languages like Markdown, Wikitext, etc.\n * 2. Serialized data is to be rendered as JSON, XML, etc.\n *\n * When rendered as serialized data, the framework will output key-value pairs,\n * objects, arrays, etc. instead of bolds, italics, headers that are considered\n * helpful for human readers in markup texts.\n *\n * HTML is a special case. It can be considered as a markup language because it\n * has the tags that are used to format the text. However, it can also be considered\n * as serialized data when using its tags to represent key-value pairs.\n *\n * Presentation can be configured in stylesheet, but it's a special style that can\n * be propagated down to the children components. All other styles are only set for\n * current active component, including the serializer language, which only affects\n * the enclosing environment of the markup/serialized.\n */\nimport * as React from 'react';\nimport { component, irElement, ReadError, trimChildrenWhiteSpace } from './base';\nexport const DefaultMarkupLang = 'markdown';\nexport const DefaultSerializer = 'json';\n// The context that stores the current presentation appraoch.\n// The language is preserved in the context,\n// because we need to know whether to create a environment with a different lang.\nconst PresentationApproach = React.createContext(undefined);\n/**\n * Get the current presentation approach.\n * Used by components to determine how to render themselves.\n */\nexport const computePresentation = (props) => {\n const result = computePresentationOrUndefined(props);\n if (!result) {\n throw ReadError.fromProps(`No presentation approach found in context or currently: ${props}`, props);\n }\n return result;\n};\nexport const computePresentationOrUndefined = (props) => {\n if (props.presentation === 'markup' ||\n props.presentation === 'serialize' ||\n props.presentation === 'free' ||\n props.presentation === 'multimedia') {\n return props.presentation;\n }\n else if (props.presentation) {\n throw ReadError.fromProps(`Invalid presentation: ${props.presentation}`, props);\n }\n const presentation = React.useContext(PresentationApproach);\n return presentation?.presentation;\n};\nexport var Markup;\n(function (Markup) {\n /**\n * Encloses a markup component.\n * It could produce nothing if it's not necessary to wrap the component.\n */\n Markup.Environment = component('Markup.Environment')((props) => {\n const parentPresentation = React.useContext(PresentationApproach);\n // presentation is extracted but not used here. We are already in markup mode.\n let { presentation, markupLang, children, originalStartIndex, originalEndIndex, writerOptions, sourcePath } = props;\n if (!markupLang) {\n if (parentPresentation?.presentation === 'markup') {\n markupLang = parentPresentation.markupLang;\n }\n else {\n markupLang = DefaultMarkupLang;\n }\n }\n return parentPresentation?.presentation === 'markup' &&\n parentPresentation.markupLang === markupLang &&\n (!writerOptions ||\n parentPresentation.writerOptions === writerOptions) ? (React.createElement(React.Fragment, null, children)) : (irElement('env', { presentation: 'markup', markupLang, writerOptions, originalStartIndex, originalEndIndex, sourcePath }, React.createElement(PresentationApproach.Provider, { value: {\n presentation: 'markup',\n markupLang: markupLang,\n writerOptions: writerOptions\n } }, trimChildrenWhiteSpace(children, props))));\n });\n Markup.EncloseSerialize = component('Markup.EncloseSerialize')((props) => {\n const { children, inline = false, ...others } = props;\n return (React.createElement(Markup.Code, { inline: inline, ...others }, children));\n });\n const SimpleMarkupComponent = (props) => {\n // Sometimes it helps to extract attributes like markupLang to avoid too many props sent to IR.\n // But this is not necessary.\n const { children, tagName, markupLang, presentation, ...others } = props;\n return (React.createElement(Markup.Environment, { markupLang: markupLang, presentation: presentation, ...others }, irElement(tagName, others, children)));\n };\n const HeaderLevel = React.createContext(1);\n // Paragraph is a block preceded by a newline and followed by a newline.\n // The paragraph in our context is the most common block element.\n // It can be nested, and represent complex sections and rich texts.\n Markup.Paragraph = component('Markup.Paragraph')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"p\" }, children));\n });\n // Inline is a light-weight element that is wrapped by two spaces.\n Markup.Inline = component('Markup.Inline')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"span\" }, children));\n });\n Markup.Newline = component('Markup.Newline')((props) => {\n const { newlineCount, ...others } = props;\n return (React.createElement(Markup.Environment, { ...others }, irElement('nl', { count: newlineCount, ...others })));\n });\n // Header is a block that is usually used to emphasize the title of a section.\n Markup.Header = component('Markup.Header')((props) => {\n const ctxLevel = React.useContext(HeaderLevel);\n const { children, ...others } = props;\n return (React.createElement(Markup.Environment, { ...others }, irElement('h', {\n level: ctxLevel,\n ...others\n }, children)));\n });\n // SubContent usually follows a header and states that the headers inside it are sub-headers.\n // It's same as a paragraph in all other aspects.\n Markup.SubContent = component('Markup.SubContent')((props) => {\n const { children, ...others } = props;\n const ctxLevel = React.useContext(HeaderLevel);\n // needn't trim here.\n return (React.createElement(HeaderLevel.Provider, { value: ctxLevel + 1 },\n React.createElement(Markup.Paragraph, { ...others }, children)));\n });\n // Bold is a Inline element that is used to emphasize the text.\n Markup.Bold = component('Markup.Bold')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"b\" }, children));\n });\n // Italic is a Inline element that is used to emphasize the text.\n Markup.Italic = component('Markup.Italic')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"i\" }, children));\n });\n // Strikethrough is a Inline element that is used to represent deleted text.\n Markup.Strikethrough = component('Markup.Strikethrough')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"s\" }, children));\n });\n // Underline is a Inline element that is used to represent underlined text.\n Markup.Underline = component('Markup.Underline')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"u\" }, children));\n });\n Markup.Code = component('Markup.Code')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"code\" }, children));\n });\n Markup.ListContext = React.createContext(undefined);\n Markup.ListItemIndexContext = React.createContext(0);\n Markup.List = component('Markup.List')((props) => {\n const { children, listStyle = 'dash', ...others } = props;\n if (!['star', 'dash', 'plus', 'decimal', 'latin'].includes(listStyle)) {\n throw ReadError.fromProps(`Invalid list style: ${listStyle}`, others);\n }\n return (React.createElement(Markup.Environment, { ...others }, irElement('list', { listStyle, ...others }, children)));\n });\n Markup.ListItem = component('Markup.ListItem')((props) => {\n const { children, ...others } = props;\n return irElement('item', { ...others }, children);\n });\n Markup.TableContainer = component('Markup.TableContainer')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"table\" }, children));\n });\n Markup.TableHead = component('Markup.TableHead')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"thead\" }, children));\n });\n Markup.TableBody = component('Markup.TableBody')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"tbody\" }, children));\n });\n Markup.TableRow = component('Markup.TableRow')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"trow\" }, children));\n });\n Markup.TableCell = component('Markup.TableCell')((props) => {\n const { children, ...others } = props;\n return (React.createElement(SimpleMarkupComponent, { ...others, tagName: \"tcell\" }, children));\n });\n})(Markup || (Markup = {}));\nexport var Serialize;\n(function (Serialize) {\n /**\n * Encloses a serialize component.\n * It becomes transparent when already in a serialized environment.\n *\n * When environment exists, the writer does things to render the environment.\n * How environment handles its child elements is very similar to the Any component,\n * except when the environment only contains a single element, in which case it will be directly returned\n * if it's unnamed.\n */\n Serialize.Environment = component('Serialize.Environment')((props) => {\n const parentPresentation = React.useContext(PresentationApproach);\n // presentation is extracted but not used here. We are already in serialize mode.\n // The env IR element only accepts a limited subset. Make sure others is not used here.\n let { presentation, serializer, children, originalStartIndex, originalEndIndex, writerOptions, sourcePath, ...others } = props;\n if (!serializer) {\n if (parentPresentation?.presentation === 'serialize') {\n serializer = parentPresentation.serializer;\n }\n else {\n serializer = DefaultSerializer;\n }\n }\n let elem = parentPresentation?.presentation === 'serialize' &&\n parentPresentation?.serializer === serializer &&\n (!writerOptions || parentPresentation?.writerOptions === writerOptions) ? (React.createElement(React.Fragment, null, children)) : (irElement('env', {\n presentation: 'serialize',\n serializer,\n originalStartIndex,\n originalEndIndex,\n writerOptions,\n sourcePath\n }, React.createElement(PresentationApproach.Provider, { value: {\n presentation: 'serialize',\n serializer: serializer,\n writerOptions: writerOptions\n } }, trimChildrenWhiteSpace(children, props))));\n if (parentPresentation?.presentation === 'markup') {\n // If the parent is in markup mode, we need a wrapper (e.g., ```json...```).\n // TODO: support inline = true\n elem = (React.createElement(Markup.EncloseSerialize, { inline: false, lang: serializer, ...others }, elem));\n }\n return elem;\n });\n /**\n * Value is a single value or (usually) a pair of key and value. The behavior is as follows:\n * 1. If the inner children are one single text element, it renders as a single value with the specified type.\n * 2. Otherwise, it can be either a list or an object depending on its children.\n *\n * Detailed implementation might differ between different writers, but generally:\n * 1. When the children contain all named values and type is not array, it presents as an object.\n * 2. When the children contain unnamed values, it presents as a list.\n * 3. When the children contain multiple elements including text elements, they are concatenated into a list.\n */\n Serialize.Any = component('Serialize.Any')((props) => {\n const { name, type, children, ...others } = props;\n const attrs = {};\n if (name !== undefined) {\n attrs.name = name;\n }\n if (type === undefined) {\n if (typeof children === 'string') {\n attrs.type = 'string';\n }\n else if (typeof children === 'number') {\n attrs.type = Number.isInteger(children) ? 'integer' : 'float';\n }\n else if (typeof children === 'boolean') {\n attrs.type = 'boolean';\n }\n else if (children === null || children === undefined) {\n attrs.type = 'null';\n }\n }\n else {\n attrs.type = type;\n }\n return (React.createElement(Serialize.Environment, { ...others }, irElement('any', { name, type, ...others }, children)));\n });\n // Object is to quickly insert an external data into the current document.\n Serialize.Object = component('Serialize.Object')((props) => {\n const { data, ...others } = props;\n return (React.createElement(Serialize.Environment, { ...others }, irElement('obj', { data: JSON.stringify(data), ...others })));\n });\n})(Serialize || (Serialize = {}));\nexport var Free;\n(function (Free) {\n /**\n * The free environment marks the content as free-form text,\n * which will be kept as is without any processing.\n */\n Free.Environment = component('Free.Environment')((props) => {\n const parentPresentation = React.useContext(PresentationApproach);\n // presentation is extracted but not used here. We are already in serialize mode.\n // The env IR element only accepts a limited subset. Make sure others is not used here.\n const { presentation, children, originalStartIndex, originalEndIndex, writerOptions, sourcePath, whiteSpace = 'pre', ...others } = props;\n let elem = parentPresentation?.presentation === 'free' &&\n (!writerOptions || parentPresentation?.writerOptions === writerOptions) ? (React.createElement(React.Fragment, null, children)) : (irElement('env', { presentation: 'free', originalStartIndex, originalEndIndex, writerOptions, whiteSpace, sourcePath }, React.createElement(PresentationApproach.Provider, { value: {\n presentation: 'free',\n writerOptions: writerOptions\n } }, trimChildrenWhiteSpace(children, { ...props, whiteSpace }))));\n if (parentPresentation?.presentation === 'markup') {\n // If the parent is in markup mode, we need a wrapper (e.g., ```...```).\n // TODO: support inline = true\n elem = (React.createElement(Markup.EncloseSerialize, { inline: false, ...others }, elem));\n }\n else if (parentPresentation?.presentation === 'serialize') {\n // Make it a string\n elem = React.createElement(Serialize.Any, { ...others }, elem);\n }\n return elem;\n });\n // This exists only because sometimes we needs to set attributes on free text.\n // For example, class names and speakers.\n Free.Text = component('Free.Text')((props) => {\n const { children, whiteSpace = 'pre', ...others } = props;\n return (React.createElement(Free.Environment, { whiteSpace: whiteSpace, ...others }, irElement('text', { whiteSpace, ...others }, children)));\n });\n})(Free || (Free = {}));\nexport var MultiMedia;\n(function (MultiMedia) {\n MultiMedia.Environment = component('MultiMedia.Environment')((props) => {\n const parentPresentation = React.useContext(PresentationApproach);\n const { presentation, children, originalStartIndex, originalEndIndex, writerOptions, sourcePath, ...others } = props;\n return parentPresentation?.presentation === 'multimedia' &&\n (!writerOptions || parentPresentation?.writerOptions === writerOptions) ? (React.createElement(React.Fragment, null, children)) : (irElement('env', { presentation: 'multimedia', originalStartIndex, originalEndIndex, writerOptions, sourcePath }, React.createElement(PresentationApproach.Provider, { value: {\n presentation: 'multimedia',\n writerOptions: writerOptions\n } }, trimChildrenWhiteSpace(children, props))));\n });\n MultiMedia.Image = component('MultiMedia.Image')((props) => {\n const { ...others } = props;\n return (React.createElement(MultiMedia.Environment, { ...others }, irElement('img', { ...others })));\n });\n MultiMedia.Audio = component('MultiMedia.Audio')((props) => {\n const { ...others } = props;\n return (React.createElement(MultiMedia.Environment, { ...others }, irElement('audio', { ...others })));\n });\n MultiMedia.ToolRequest = component('MultiMedia.ToolRequest')((props) => {\n const { id, name, parameters, ...others } = props;\n return (React.createElement(MultiMedia.Environment, { ...others }, irElement('toolrequest', { id, name, content: parameters, ...others })));\n });\n MultiMedia.ToolResponse = component('MultiMedia.ToolResponse')((props) => {\n const { id, name, children, ...others } = props;\n return (React.createElement(MultiMedia.Environment, { ...others }, irElement('toolresponse', { id, name, ...others }, children)));\n });\n})(MultiMedia || (MultiMedia = {}));\n//# sourceMappingURL=presentation.js.map"],"names":["React","ReadError","Markup","component","irElement","trimChildrenWhiteSpace","Serialize","Free","MultiMedia"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGY,MAAC,iBAAiB,GAAG;AACrB,MAAC,iBAAiB,GAAG;AACjC;AACA;AACA;AACA,MAAM,oBAAoB,GAAGA,gBAAK,CAAC,aAAa,CAAC,SAAS,CAAC;AAY/C,MAAC,8BAA8B,GAAG,CAAC,KAAK,KAAK;AACzD,IAAI,IAAI,KAAK,CAAC,YAAY,KAAK,QAAQ;AACvC,QAAQ,KAAK,CAAC,YAAY,KAAK,WAAW;AAC1C,QAAQ,KAAK,CAAC,YAAY,KAAK,MAAM;AACrC,QAAQ,KAAK,CAAC,YAAY,KAAK,YAAY,EAAE;AAC7C,QAAQ,OAAO,KAAK,CAAC,YAAY;AACjC;AACA,SAAS,IAAI,KAAK,CAAC,YAAY,EAAE;AACjC,QAAQ,MAAMC,cAAS,CAAC,SAAS,CAAC,CAAC,sBAAsB,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,KAAK,CAAC;AACvF;AACA,IAAI,MAAM,YAAY,GAAGD,gBAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC;AAC/D,IAAI,OAAO,YAAY,EAAE,YAAY;AACrC;AACWE;AAC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